The Web Just This Site

NM Web Tutorials

Manipulate Text: Manipulate Section

The big question from here is how do you manipulate just a certain section? Remember those <div> tags from before? Well now we are going to give them a name, you can name it whatever you want, like this <div id="my_section">. You only do this to the first <div> however, the closing one is still </div>. You can ad id to just about any tag, you can ad them to <p> tags, after the a in an <a href..., but you’ll especially see in the layout section how useful it is to have div id’s. We are going to us CSS to refer to these names. Also be sure to see the advantage/disadvantage to using a class names, or id names.

Lets say we use the same Style Rule as before, except we are going to use #my_section as the selector, like this #my_section {color: #ff0000;}.

XHTML

What The Code Does

<div id="my_section">

 

<p>blah blah blah, some content, other interesting stuff</p>

 

<p>a whole other paragraph worth of interesting stuff</p>

 

</div>

 

<p>we are now out of the section</p>

 

 

 

blah blah blah, some content, other interesting stuff

a whole other paragraph worth of interesting stuff

we are now out of the section

 

This way everything within the division is effected by the Style Rule you created for it. If you wanted to effect more than one type of tag with the same declarations, simply ad a comma between each one, like this: em, i, strong, b {color: #0000ff;}.