stfc_boy
07-09-2008, 01:15 PM
Hi All,
I'm completely stuck on two (pretty simple) things that I can't get my head around, and one other general question:
The first problem is my <p> tags. The text appears way beneath each other when I want it with a very small gap in-between the paragraphs. Can someone help?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html><head>
<title>Testing</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<style>
.left {
float:left;
display:inline;
width:300px;
height:200px;
background:#EEEEEE;
border: 1px solid #CCC;
}
.left:hover {
float:left;
display:inline;
border: 1px solid #FFED97;
width:300px;
height:200px;
background:#FFFDF2;
}
.left p {
font-family:verdana;
font-size:0.90em;
margin-bottom:2px;
color: #333;
}
img.the_image {
display:inline;
float:left;
padding:6px;
}
</style>
<div class="left">
<img src="image.png" width="62" height="62" class="the_image"/>
<p>» Add a News Item</p>
<p>» Add a News Item</p>
<p>» Add a News Item</p>
</div>
</body>
</html>
2) The second one is another simple one, say I have another style named .right and all of the styles are the same, rather than writing them out again can I say they are the same styles? IE something like:
.left:hover, right:hover {
float:left;
display:inline;
border: 1px solid #FFED97;
width:300px;
height:200px;
background:#FFFDF2;
}
.left p, right p {
font-family:verdana;
font-size:0.90em;
margin-bottom:2px;
color: #333;
}
3) Say all the styles were the same .left and .right, apart from one thing the background colour on .right, what's the best practice for this, just stating the new background in the style like:
<div class="right" style="background:#FFF;"></div>
Many Thanks
Chris
I'm completely stuck on two (pretty simple) things that I can't get my head around, and one other general question:
The first problem is my <p> tags. The text appears way beneath each other when I want it with a very small gap in-between the paragraphs. Can someone help?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<html><head>
<title>Testing</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
</head>
<style>
.left {
float:left;
display:inline;
width:300px;
height:200px;
background:#EEEEEE;
border: 1px solid #CCC;
}
.left:hover {
float:left;
display:inline;
border: 1px solid #FFED97;
width:300px;
height:200px;
background:#FFFDF2;
}
.left p {
font-family:verdana;
font-size:0.90em;
margin-bottom:2px;
color: #333;
}
img.the_image {
display:inline;
float:left;
padding:6px;
}
</style>
<div class="left">
<img src="image.png" width="62" height="62" class="the_image"/>
<p>» Add a News Item</p>
<p>» Add a News Item</p>
<p>» Add a News Item</p>
</div>
</body>
</html>
2) The second one is another simple one, say I have another style named .right and all of the styles are the same, rather than writing them out again can I say they are the same styles? IE something like:
.left:hover, right:hover {
float:left;
display:inline;
border: 1px solid #FFED97;
width:300px;
height:200px;
background:#FFFDF2;
}
.left p, right p {
font-family:verdana;
font-size:0.90em;
margin-bottom:2px;
color: #333;
}
3) Say all the styles were the same .left and .right, apart from one thing the background colour on .right, what's the best practice for this, just stating the new background in the style like:
<div class="right" style="background:#FFF;"></div>
Many Thanks
Chris