0

HTML

What does div do in html code. And why I can't change the font color even i use font color code?

7th Jun 2018, 11:09 AM
Jefferson Asendente
Jefferson Asendente - avatar
3 odpowiedzi
+ 5
div{ color:red; } not:: div{ font-color:red; }
7th Jun 2018, 11:25 AM
᠌᠌Code X
᠌᠌Code X - avatar
+ 4
div tags are used to divide your HTML code into sections. About your second question, it would be better if you provide a code so we can help you.
7th Jun 2018, 11:20 AM
Jonathan Pizarra (JS Challenger)
Jonathan Pizarra (JS Challenger) - avatar
+ 2
The <div> tag is a container unit that encapsulates other elements within the page and divides the HTML document into sections. example: <div> <p>Lorem Ipsum</p> </div> As far as the color of your font, keep in mind that perhaps the specificity of your CSS is overriding the font color selector you're trying to use. Example of specificity; the first div tag selector would be overridden by the div with the ID selector (#). div { color: blue; } #div { /* this selector will override */ color: yellow; } As mentioned by the comment above, use the shorthand property for the font color. example: #div { color: red; }
7th Jun 2018, 1:37 PM
Josh
Josh - avatar