PDA

View Full Version : CSS question


gigiloumill
02-18-2010, 02:41 PM
Guys, working with the CSS below I would like to know how it could be possible to have an image float anyway I wish. In other words, right now the CSS is set up to float all images "left" but, if I want the image to float right on any particular div, the standard image "float" is set to left.. Thanksbody,td,th {
color: #FFF;
}
body {
background-color: #FFF;
}
a:link {
text-decoration:underline;
}
a:visited {
text-decoration: none;
}
a:hover {
text-decoration:underline;
}
a:active {
text-decoration:underline;
}

h3 a:visited {
color: #F00;
}

h3 {
margin: 0 0 0.5em 0;
font:normal 110%/1 Arial, Helvetica, sans-serif;
letter-spacing: -0.03em;
clear: right;
color: #333;
text-align:left;
text-decoration:underline;
font-weight:bold;
}

h3: link{
text-decoration:underline;
}



.testing{
width: 845px;
font-family:Arial, Helvetica, sans-serif;
font-size:12px;
color:#000;
background-color: #FFF;
font-weight : normal;
line-height :1em;
overflow : hidden;
white-space :wrap;
text-decoration:none;
text-transform:capitalize;


border-right: 0px dotted #000;
padding-top: 5px;
padding-right: 5px;
padding-bottom: 2px;
padding-left: 5px;
margin-top: 0;
margin-right: 0px;
margin-bottom: 0;
margin-left: 0px;

}


p {
line-height: 1;



}
h2 {
text-decoration:underline;
text-transform:capitalize;
font: Tahoma, Geneva, sans-serif;
font-size:large;
font-weight:100;
background-color:#FFF;
color:#00C;
font-weight:normal;
}
h1 {
font: Tahoma, Geneva, sans-serif;
color:#00C;
font-weight:bold;
}
hr {
height: 1px;
border: 1px double #F5F5F5;
}
.ad {
float: right;
width: 300px;
margin-right: 50px;
}
.news {
width: 850px;
height: 100px;
background-color: #FFF;
text-align:left;
border-bottom: 1px dotted #F5F5F5;

}
.news1 {
height: 100px;
width: 850px;
border-bottom: 1px dotted #F5F5F5;
}
.oneone {
height: 100px;
width: 850px;
background-color: #FFF;
text-align:right;
border-bottom: 1px dotted #F5F5F5;

}

img {
border:dotted F5F5F5;

float:left;
margin: 2px 5px 2px 5px;
}

gentleone
02-18-2010, 03:22 PM
You can give that specific image a class like class="img-01" and hten style that class in your CSS with float:right. Or make two standard rules in your CSS like .left {float:left} & .right {float:right} so that you can give the img tag (or any other tag) a class left or right.

<img src="/images/imagename1.gif" alt="" class="left">
<img src="/images/imagename2.gif" alt="" class="right">

gigiloumill
02-18-2010, 03:24 PM
Thanks G...

gentleone
02-18-2010, 03:35 PM
You're welcome G...

gigiloumill
02-19-2010, 01:24 AM
Hey G, how can I include a border around the image. Setting the class was easy.. Thanks

gigiloumill
02-19-2010, 01:27 AM
Never mind...border:------;