Friday 4 December 2015

Codecademy.CSS.Session2

1. Make the <h3> color #cc6666 and the <h2> color #8a2be2
Answer:
h3 {
color: #cc6666;
}
h2{
color: #8a2be2;
}
2. Use emphasize (em) or font-size
3. Set the font-family of the <h1> header to serif, <h2> to sans-serif, <h3> to cursive.
Answer:
h1 {
font-family: Serif;
}
h2 {
font-family: Sans-serif;
}
h3 {
font-family: Cursive;
}
4. Set backup value of h1 times as an option before serif, set backup value of h2 verdana as an option before sans-serif,
h1 {
font-family: Times, Serif;
}
h2 {
font-family: Verdana, Sans-serif;
}

5. Set div's background-color to #cc0000
Set height's to 100px
Set width to 100px
Answer:
div {
background-color: #cc0000;
height: 100px;
width: 100px;
}
6. Table: set tds's height to 50px. Give your tds a border of 1 px dashed blue. Give your table a border of 1px solid black.
Answer:
td {
height: 50px;
border: 1px dashed blue;
}
table {
border: 1px solid black;
}
7. Give your a selector a color of #cc0000 and a text-decoration of none.
Answer:
a {
color: #cc0000;
text-decoration: none;
}
8. Add a pair of <h1></h1> tags inside the body of our HTML page. Your h1 header can say anything you want!
Then, on the CSS tab, make its font-family to Verdana and its color to #576D94.
Add a pair of <p></p> tags below your h1 header and set the font-size to 18px and its color to #4a4943
Answer:
h1 {
   
font-family:Verdana;
   
color:#576D94;
}
p {
   
font-size: 18px;
   
color: #4a4943;
}

9. Set the p font-family to Garamond and set a backup font of Serif. Give h1 a backup font of sans-serif.
Answer:
p {
font-family: Garamond,Serif;
}
h1 {
font-family: Verdana, Sans-serif;
}

10. Add an image and set its width and height to 300px and 100px and give your image of 1px solid #4682b4
Answer:
In index.html
<img src="http://bit.ly/NnVbxt">
In stylesheet.css
img
{
width: 300px;
height: 100px;
border: 1px solid #4682b4;
}
11. Add a link using <a href="url">Link text</a> into your HTML page and set link's text-decoration to none and its color
to #cc0000.
<a href="http://www.codecademy.com"></a>
Add this in the stylesheet.css
a {
text-decoration:none;
color:#cc0000;
}

No comments:

Post a Comment