 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
jenniferesme
Joined: 02 Apr 2005 Posts: 4
|
Posted: Thu Apr 14, 2005 6:27 am setting attributes in <div> tag |
|
|
|
I have used the <div class="leftbox"></div> tags to make a box, and I want to change only that stuff in the box to float left and have a 30% width. I can't figure out how to do this using CSS style. Thank you.
<div class="leftbox" >
{width:30%;float:left}
<h5> <a href="const.htm">Antiques</a></h5>
<h5><a href="const.htm">Books</h5>
<h5><a href="const.htm">Clothes</a></h5>
<h5><a href="const.htm">Electronics</a></h5>
<h5><a href="const.htm">Furniture</a></h5>
<h5><a href="const.htm">Jewelry</a></h5>
<h5><a href="const.htm">Music and Videos</a></h5>
<h5><a href="const.htm">Sporting Goods</a></h5>
</div> |
|
degsy

Joined: 23 Feb 2005 Posts: 2440 Location: North East, UK
|
|
jenniferesme
Joined: 02 Apr 2005 Posts: 4
|
Posted: Thu Apr 14, 2005 6:48 am follow up ? |
|
|
|
| Many thanks! I assume, then, that if I want to make further changes (like font color) I need to put it into the <style> tags? |
|
degsy

Joined: 23 Feb 2005 Posts: 2440 Location: North East, UK
|
Posted: Thu Apr 14, 2005 8:00 am |
|
|
|
Yes, once you have defined the class you can add/alter it to suit
| Code: |
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
.leftbox {
font-family: Arial, Helvetica, sans-serif;
font-size: large;
font-weight: normal;
color: #000000;
background-color: #FFFFCC;
padding: 5%;
float: left;
width: 30%;
border: thin solid #000000;
}
.rightbox {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: large;
font-weight: bold;
color: #FFFFFF;
background-color: #330066;
padding: 2%;
width: 30%;
margin-left: 50%;
border: thin dashed #6600FF;
}
-->
</style>
</head>
<body>
<div class="leftbox">.leftbox {<br>
font-family: Arial, Helvetica, sans-serif;<br>
font-size: large;<br>
font-weight: normal;<br>
color: #000000;<br>
background-color: #FFFFCC;<br>
padding: 5%;<br>
float: left;<br>
width: 30%;<br>
border: thin solid #000000;<br>
}</div>
<div class="rightbox">.rightbox {<br>
font-family: Georgia, "Times New Roman", Times, serif;<br>
font-size: large;<br>
font-weight: bold;<br>
color: #FFFFFF;<br>
background-color: #330066;<br>
padding: 2%;<br>
width: 30%;<br>
margin-left: 50%;<br>
border: thin dashed #6600FF;<br>
}</div>
</body>
</html>
|
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|
|
 |
|
|
|
|
|
|
|