FRIHOST FORUMS SEARCH FAQ TOS BLOGS COMPETITIONS
You are invited to Log in or Register a free Frihost Account!


Can l get a CSS document to...





KHO
make every image on the page have a set hight, width, and border?
l thought it would look something like this
img {
border="none";
"height: 88px;
width: 120px;"
}
but that did nothing, maybe l have the code wrong? And it has to be in an external CSS sheet, l do not want to have to type this a thousand times.
BlackSkad
You can set the border like below;
first param is the width (0px), second the color (#000000), third sets the style (solid);
for more information, see w3schools: borders

Code:

border: 0px #000000 solid;


Greatz,
BlackSkad
KHO
yes, l know how to set a border. You can also set borfer to "none" instead of just hiding it Neutral
but l need to get a .css document to do that for me so that every time l do <img src="ur" /> it will pick up the img tag and give it the values l specified above. l don't even know if this is possible, but if it is, it would save me alot of time.
mathiaus
KHO wrote:
yes, l know how to set a border.

KHO wrote:
border="none";

Well thats not the way to do it in CSS. remove it or correct and the height and width will work properly Wink
JustaMin
You have errors in your CSS, try this:

Code:

img {
border: none;
height: 88px;
width: 120px;
}


Also you may want to consider using a custom class so that only images in certain parts of your page are affected:

Code:

.thumb img {
border: none;
height: 88px;
width: 120px;
}

<span class="thumb">
  <img src="1.jpg" />
  <img src="2.jpg" />
  <img src="3.jpg" />
  etc
</span>
SystemWisdom
Expanding on the code from above yields:

Code:

img.thumb{
border: none;
height: 88px;
width: 120px;
}

<img class="thumb" src="1.jpg" />
<img src="2.jpg" />
<img src="3.jpg" />



Now only the first image will have the applied style 'thumb' without the need for extra 'span' tags in your html.
KHO
Alright it works! Thank you, and l'm just gonna have it do the image thing for all images, its more of a photo albumn site anyway. And besides, for the occasional image that needs to be changed, l can specify that individually in the HTML document, but l think the only one that will is probably going to be in its own document, so l will just make it it's own .css file.
Related topics
problem with attached css style sheet
Can l get a css document to
LAY FOR PAGE 25-40 POINTS
Ie.why do people use it..anyway, because I have to use it...
i need this
Could somebody test out my order form?
Weird Mac/Safari Problem
CSS problem - very simple css dont work in Firefox/Opera.
CSS: class and id
help needed with css & javascript
How to make CSS-changing JS target a frame
Problem placing footer
Have your layout coded for $50 frih!!! (XHTML & CSS)
BLAH! CSS + HTML!
Reply to topic    Frihost Forum Index -> Scripting -> Php and MySQL

FRIHOST HOME | FAQ | TOS | ABOUT US | CONTACT US | SITE MAP
© 2005-2011 Frihost, forums powered by phpBB.