This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="box"> | |
<h1>Heading</h1> | |
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Cras ac mi tellus, at ornare risus. Donec at diam id purus eleifend | |
congue.</p> | |
</div> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p class="pink">This paragraph will be pink</p> | |
<p> This paragraph will not be pink</p> | |
<h1 class="pink">This heading will be pink</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<p><span class="red">Hello</span>there test taker !</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<h1 id="pink">Pink Heading</h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Using the property 'display' there are two values that can be associated with it. | |
The first property is inline, the elements affected by it are displayed inline follow the flow of a line. | |
The second property is block, which separated the elements affected by it by a line break. | |
This is useful to override the way that HTML displays itself by default; for example, look at the <h1> tag. | |
Every instance of the h1 tag, or any header tag, is immediately followed by a line break. | |
However if I used the following CSS: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You can also compose id selectors and html selectors. | |
For any id value "id" and any html tag "tag" | |
#id tag { | |
[some CSS] | |
} | |
Only the tag instance with the id value "id" will be styled under the properties in [some CSS]. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
For any html tag "tag" | |
and for any class value "class" | |
tag.class { | |
[some CSS] | |
} | |
That snippet of CSS will style each element with both tag type "tag" and the class value "class". | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Well to do that, you simply combine the two types of selectors. | |
Say you had some HTML like this; | |
<h1>Example</h1> | |
<h1 class="first">This is my first heading</h1> | |
<p class="first"> This is my first paragraph</p> | |
<h2 class="second">This is my second heading</h2> | |
<p class="second"> This is my second paragraph</p> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.big { | |
font-size:2em; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<body> | |
<h1 class="big">Heading</h1> | |
<p class="big">lorem ipsum dolor sit amet</p> | |
<p>Second Paragraph</p> | |
<ul> | |
<ol class="big">This is a list</ol> | |
</ul> | |
</body> |
NewerOlder