Welcome!

And don't forget to edit your signature & profile.

 

Icon

Statistics

  • Total posts 23318
  • Total topics 4049
  • Total members 5574
  • Our newest member
    ALF5583

TOP POSTERS

CSS code not reflecting

All problems and developments related to (X)HTML-markup and stylesheets are discussed and resolved here.
   

CSS code not reflecting

Postby kaymeis » Wed Oct 28, 2009 2:54 pm

hi, my CSS code is not rendering at all. The only element working is the background color. I've cleaned out all the temporary Internet files in my folder and still, onlt the background color is working. Here is the code for both css and xhtml


CSS

body{background-color:#87ceeb;
}

i

.akshion{font-size:24;
font-weight:bold;
color: #66ccff;
font-style: italic;
text-align: left;
}

align.left{display:block;
width:640px;
height:400px;
background:blue;



XHTML
<link href="atk.css" rel="stylesheet" type="text/css" />
<body>
<img src="ak-shion.gif" width="640" height="400" alt="Ak-Shion" class="align.left"/>

<h1 class="akshion">Ak-Shion <h1/>


</body>
</html>
}
kaymeis
 
Posts: 5
Joined: Wed Oct 28, 2009 2:42 pm
   

   

Re: CSS code not reflecting

Postby falkencreative » Wed Oct 28, 2009 3:53 pm

You have some incorrect formatting... You also can't have periods in your class names. (No "align.left" -- it needs to be "alignleft").

CSS:
Code: Select all
body { background-color:#87ceeb; }

i <-- unnecessary extra character. Could be causing issues.

.akshion{font-size:24; <-- incorrect. Should be in pixels, ems, etc.
font-weight:bold;
color: #66ccff;
font-style: italic;
text-align: left;}

align.left { display:block; <-- no period in the middle of a class name. Needs period at the beginning of the class name.
width:640px;
height:400px;
background:blue;
<-- need closing bracket



XHTML:
This needs proper code, including doctyype, opening /closing html and head tags.
Code: Select all
<!-- add doctype here -->
<html>
<head>
<title>title here</title>
<link href="atk.css" rel="stylesheet" type="text/css" />
</head>
<body>
<img src="ak-shion.gif" width="640" height="400" alt="Ak-Shion" class="align.left"/> <-- change class to "alignleft"

<h1 class="akshion">Ak-Shion <h1/>


</body>
</html>
Benjamin Falk | student : designer : developer
http://www.falkencreative.com | http://www.twitter.com/falkencreative
User avatar
falkencreative
Smashing <li>
 
Posts: 261
Joined: Sun Jan 18, 2009 7:25 pm
Location: Chico, CA
   

   

Re: CSS code not reflecting

Postby Andy » Wed Oct 28, 2009 4:52 pm

falkencreative wrote:You also can't have periods in your class names. (No "align.left" -- it needs to be "alignleft").


That's correct because:

Code: Select all
.align.left {
  ..
}


maps to two different classes. That is, an element that has both "align" and "left":

Code: Select all
<div class="align left">

</div>


They should be avoided when working with IE6.
Andy
Smashing <h5>
 
Posts: 1023
Joined: Tue Sep 30, 2008 6:42 pm
Location: Sweden
   


Return to CSS and (X)HTML



Who is online

Users browsing this forum: No registered users and 1 guest