New to HTML and CSS
I am new to html and css and currently learning using Head first HTML with CSS and XHTML to study.
This book so far is a great book but i am having trouble with one of the examples that they have given. I have gone over this about 10 times and cant see anything wrong with the code but my page just wont change background colour. I am using IE8 and below is the code if someone can tell me waht i am doing wrong.
Any help would be greatly appreciated.
<title> Starbuzz Coffee </title>
border: 1px dotted gray;
padding: 10px 10px 10px 10px;
<h1> Starbuzz Coffee Beverages </h1>
<h2> House Blend, $1.49 </h2>
A smooth, mild blend of coffees from Mexico, Bolivia and Guatemala.
<h2> Mocha Cafe Latte, $2.35 </h2>
Espresso, steamed milk and chocolate syrup.
<h2> Cappucinno, $1.89 </h2>
A mixture of espresso, steamed milk and foam.
<h2> Chai Tea, $1.85 </h2>
A spicy drink made with black tea, spices, milk and honey.
Last edited by Kor; 11-24-2011 at 07:49 AM.
Reason: wrap the code [code][/code]
You must be one of Her Majesty's subject, I presume Unfortunately, at least for you, in almost all the programming languages it is used the American spelling, not the British one.
Same with grey(British)/gray(American), centre(British)/center(American), metre(in British English is the unit)/meter(in British E. is the device for measuring, while in American E. means both the unit and the device)
And so on...
Last edited by Kor; 11-24-2011 at 08:13 AM.
Thanks for your reply, i kicked my self when i saw the error. Just one more thing, i have also noticed that the gray (not grey) border has not appeared either. Is this another silly mistake i have missed? Not sure why i can't see it.
Use rather colors values in hexa (for instance one of the gray nuances can be '#ccc') or rgb
Set a real font family. Like: font-family:Arial, Helvetica, sans-serif;
Thanks, i did find the problem that was causing the border not to appear. I will post this below.
The answer is pretty simple actually. In later chapters you'll figure out that a document type is needed to tell the browser which version of HTML you used to create your web page.
So by using this doctype:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
Your saying that your web page is using HTML version 4.01. With out telling the browser this your basically telling it to revert back to the dark ages (default HTML).
Thanks for your help.
No. It is not the "dark ages". HTML4.01 is as good as XHTML or HTML5. It depends only on what do you want to do on your site. In fact HTML5 allows both HTML4.01 strict or XHTML strict syntax, on will.
Originally Posted by jasona7791
Ya I check this it work nicely but it don't show any color which you in css declaration. So what can I do for get color.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)