Thanks for your reply but i dont know where to put it in my html i have posted complete html source i would really appreciate if you could tell me where to put it in my html code
You can place center in the body tag, or you can just put it before the body tag and just put <center>
Things like <center> and <font> tags have been deprecated since 1999. CSS has replaced those as designers are encouraged to separate formatting from markup.
Originally Posted by meesam512
Thanks for your reply but i dont know where to put it in my html i have posted complete html source i would really appreciate if you could tell me where to put it in my html code
regards.
Create a file named styles and save it with an extension of .css. You may have to save it as a "All Files" type to do so. Do not try to save it as a specific file type, ie a text file. Put that file in the same folder as your HTML page.
Things like <center> and <font> tags have been deprecated since 1999. CSS has replaced those as designers are encouraged to separate formatting from markup.
Create a file named styles and save it with an extension of .css. You may have to save it as a "All Files" type to do so. Do not try to save it as a specific file type, ie a text file. Put that file in the same folder as your HTML page.
Weird, i just got a certificate for web development and they didn't seem to have a problem with it. So i guess they just want all their styles in css files from now on? sigh that takes forever! lol thanks for letting me know though. Also i am a bit lost now and haven't done any coding in a while, could you show me an easy example of how i would put each style on each part of the page i wanted? such as the header and how id' get it to link to the header, and the content and etc.? thank you
Weird, i just got a certificate for web development and they didn't seem to have a problem with it. So i guess they just want all their styles in css files from now on? sigh that takes forever! lol thanks for letting me know though. Also i am a bit lost now and haven't done any coding in a while, could you show me an easy example of how i would put each style on each part of the page i wanted? such as the header and how id' get it to link to the header, and the content and etc.? thank you
What takes forever is placing all of your formatting in a inside of each page and then deciding you want to do a redesign and thus you need to change the code on every single page. Also, the CSS file is downloaded to the browser once. Anytime you use the that file again, it's already there.
There's a lot to cover even for the basics, but here's a quick run down.
In a CSS file.
To change the color of text in a <h1> tag.
Code:
h1 {
color:#000;
}
Let's say there is a link inside of the <h1> tag.
Code:
h1 a {
color:#000;
}
Note, what that is saying is for any <a> tag that is inside of a <h1> tag to be the color of black(#000).
Let's say you want any of the numbered <h#> tags to have the same color.
Code:
h1, h2, h3, h4, h5, h6 {
color:#000;
}
Define a style for a class attribute with the value named "bob."
Code:
.bob {
color:#000;
}
Note, a page can use a class more than once.
Ex.
Code:
<p class="bob">What About Bob?</p>
<p class="bob">Bob is so keen.</p>
Define a style for an id attribute with the value named "joe."
Code:
#joe {
color:#000;
}
Note, a page can only have one specific id.
Code:
<p id="joe">There can only be one of me!</p>
<p id="sam">Thank god for that.</p>
And the advanced mind bender
Code:
<div>
<p id="joe"><a class="bob" href="index.html">It's me, Joe Bob.</a></p>
</div>
CSS
Code:
div #joe .bob {
color:#000;
}
For every bob class within a joe id that is inside of a <div> tag needs to be colored black.
Further old school fun. Every design has the same markup unless otherwise noted. The only difference is the external CSS and images.
Bookmarks