CSS baby steps

Posted on 2011-10-13
Last Modified: 2012-05-12
I am not seeing my CSS applied to my test web page
Here is the html and here is the css
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns="">
<title>MY NAME</title>
<link href="./style.css" type="test/css" rel="stylesheet" />


        <h1>My Name</h1>

        <li>  I like school</li>
        <li> I like the movie <a href="">Dr.Strangelove</a></li>
        <li> Here is me when I'm happy: <img src="./images/happy.jpg" alt="Happy" width="160" height="110" />  This is
when I'm 
sad: <img src="./images/sad.png" alt="sad" width="160" height="110" /></li>
        <li>I think that comic sans is the font of choice for all serious business</li>

        <a href=""><img src="../w3c-xhtml11.png" alt="Valid XHTML 1.1" /></a>
        <a href=""><img src="../w3c-css.png" alt="Valid CSS!" /></a>

Open in new window

body {
	background-color: green;
h1 {
	color: red;

Open in new window

Question by:GPicasso
    LVL 6

    Expert Comment

    Change this line to:
    <link href="style.css" type="test/css" rel="stylesheet" media="all">

    Open in new window

    The " />" closing this line is only required if you're using the XHTML DOCTYPE - and you've left DOCTYPE out which I believe defaults to HTML 4 transitional.
    LVL 9

    Accepted Solution

    You may put your file in wrong folder. I think that style.css should be in current_folder/test/css folder.  Where current_folder is the folder holding the html file

    Author Closing Comment

    Close dude it was just under both our noses
    test/css.. lol it should have been text/css
    LVL 6

    Expert Comment

    Lol. Copy/paste/presume!

    Should have typed it out. Nice pick up

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    When applying CSS to your HTML, there are many different ways to select which element(s) the CSS applies to.  Some of these selectors are more commonly known and used than others - Here are the more common ones: #X - Matches an ID of X .X - Matche…
    Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
    In this tutorial viewers will learn how to style a decorative dropcap for the first letter in a paragraph using CSS. In CSS, create a new paragraph class by typing "p.fancy": Then, to style only the first letter of the first sentence, include the ps…
    In this tutorial viewers will learn how to style rounded corners for elements in CSS using the border-radius property Begin with a normal styled element such as a div: To style all four corners of the div to be the same degree of roundness, use the …

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    13 Experts available now in Live!

    Get 1:1 Help Now