CSS - What Is The Css Syntax For Setting The Image Width And Height??
I'm wondering what's the word is called for setting the image width and height in CSS
Code: img.test { <<What's the keyword??>>: 10 px; } Thanks, FletchSOD Similar TutorialsI'm trying to make up a thumbnail page that shows pics in a row at a constant height. I don't want the images distorted so the width will vary. I tried: Code: img.proj_thumb {border-style:none; height:75px; width:auto} Ths worked on mylaptop, but fails on the server - see the attached pics. Any suggestions? Hi Guys, Consider the following box: PHP Code: <div style=border: 1mm black Solid; width: 148mm; height: 98mm;'> </div> 148mm + 1mm + 1mm = width of 150mm 98mm + 1mm + 1mm = width of 100mm Now why does neither firefox or ie manage to get it? Firefox is about 2mm out and ie is about 3mm out? Any ideas or is it some quirk? Charlie I'm at the very very very begaining of a table-less design (my first, actually). The problem is, since I have decided to have a non-fixed width, when the browser is minimized, at a certain point the design breaks. See it here (please don't make fun! it's just the start): SiliconSatan.com/test.php I'd like to set a minimum width, probably on the container <div>, so at a certain point it sort of becomes like a fixed width? No smaller than a set width? [EDIT] Also, I have a question about background color mismatch, but it was not quite OT for the CSS forum: http://forums.devshed.com/web-desig...e7t-403266.html Hi, I have hit the "wall" in my knowledge of CSS while trying to implement a "flex-width-equal-height-sidebar-layout" style of layout as a skin/theme for a message board system and need some help. My trouble occurs when a direct link to the post is used (instead of following the menu navigation system) where the top menu information/links area (the area between the banner and the post) is chopped off... The relevant portion of the CSS seems to be the .col_wrap {margin-top: 10px; border: 0; overflow: hidden; float: left; width: 100%; position: relative; z-index: 10; clear: both;} portion of my CSS because if I take out the overflow:hidden declaration then the menu portion of the skin/theme/layout shows correctly but the sidebar the shows the part which should be hidden at the bottom and the footer completely vanishes from view! My apologies but this is the best I can do without having the ability to post pics or urls which could better explain what is wrong and frankly speaking I don't know how anyone here can help given my inability to show the problem but hopefully someone knows or has run into this problem before or can offer some resources that may be of assistance.... Ok so I have a logowrap layer which is at 100%. I have the actual logo set with 'float:right;' with a width of 900px. Now i have a layer just before that with float:left;, but i want to set the width with the remaining space, so all resolutions will render it the same way, whether it be a 1280*760 - or whatever. CSS: Code: #logowrap { width:100%; background-color:#000000; } #logonavtext { float:left; color:#0099FF; padding:2px; } #logonavtext ul { list-style:none; } #logonavtext li { display:inline; margin-right:30px; } #logowrapimg { float:right; width:900px } HTML: Code: <div id="logowrap"> <div id="logonavtext"> <ul> <li>[ I ]</li> <li>[ II ]</li> <li>[ III ]</li> <li>[ IV ]</li> <li>[ V ]</li> <li>[ VI ]</li> <li>[ VII ]</li> <li>[ VIII ]</li> <li>[ IX ]</li> </ul> </div> <div id="logowrapimg"> <?php include('scripts/logorandom.php'); ?> </div> <div class="clear"> </div> </div> Any help would be great. Of course If you have a better way, I would more then welcome it. Coding my site up, and I've hit a stump. I've got a box div that I'm putting text in. I try adjusting the height, and it works fine in Mozilla/Firebird, but IE just seems to ignore it (which is causing me problems). Anyone familiar with this? http://tonglebeak.ath.cx/boards/ In firefox, it renders as I expect it to: the caption is half the width of the table, and the caption is centered. In IE, however, it doesn't want to become half the width of the table. Hell, setting a px amount doesn't even affect it. What can be done to fix this in IE? Okay i have been working on this for a while now, and i hate asking for help.. but i have given up on it. Firstly i started using display:inline-block; which meant i could have a width so my hover over menu effect would work. But this did not work in IE7 which means it is useless to what i am doing. So i then moved onto Display:inline; This worked fine, in both IE and Firefox, but the width cannot be set with this value. This value just wraps itself around the content. But i need to set a width to the Inline value. Any help? CSS: Code: #navcontainer ul{ margin: 0; padding: 0; list-style-type: none; text-align: center; } #navcontainer ul li { display: inline; width: 65px; height: 21px; background: url("images/tabbg.gif") 0 0 no-repeat; text-decoration: none; text-align:center; } #navcontainer ul li a{ display:inline; width: 65px; height: 21px; background: url("images/tabbg.gif") 0 0 no-repeat; text-decoration: none; } #navcontainer ul li a:hover{ background-position: -65px 0; color:#FFFFFF; } html: Code: <div id="navcontainer"> <ul> <li><a href="#">Milk</a></li> <li><a href="#">Eggs</a></li> <li><a href="#">Cheese</a></li> <li><a href="#">Vegetables</a></li> <li><a href="#">Fruit</a></li> </ul> </div> Also a link to the actual page is http://www.therow2.com/adsense/zzzzzzzzzzzzzzz.php for some reason when i declare a div as "display: inline", the width is ignored. as soon as i take display: inline out, the width goes to what i set it to. Code: #jobs_list{ background-color: #ffe6c4; padding: 5px; clear: both; overflow: auto; width: 600px; } #jobs_list .heading{ width: 200px; display: inline; } #jobs_list .title{ font-weight: bold; text-align: left; } #jobs_list .company{ text-align: center; } #jobs_list .location{ text-align: right; } <div id="jobs_list"> <div class="heading title">Title</div> <div class="heading company">Company</div> <div class="heading location">location</div> </div> Hi guys, Before I go on, here's the page I'm referring to: http://student-consolidation-loans.co.uk/newsite3/ In IE 6 on the PC the layout is how I want it, however, skip over to the mac and it doesn't look correct in any browser (safari, IE, firefox...) The problem is I've given one of the DIVs (the one that contains the white and black diagonally striped background) an auto height so it stretches to fit all the content, but while IE 6 is picking up on this none of the mac browsers are. Is there a workaround? thanks! Hi, I'm trying to create horizontal navigation with drop-down menus using strictly CSS. I've followed the tutorial located at: http://www.htmldog.com/articles/suckerfish/dropdowns/ but instead of having text for the main navigation, I'm using a transparent PNG and having text for strictly the drop-down section. To create the background of the navigation, I'm simply changing the background: property since the PNG images are transparent. My problem is that the navigation isn't lining up correctly. It's irratic. Each PNG has absolutely no white space in front of or after it, so it's not that. It simply isn't lining up how it should. I wanted it to be right next to each other and I could simply adjust the width inbetween each one with the margin: property, but I can't get it working. The page can be found he http://serve5.net/xcage/nav/ http://serve5.net/xcage/nav/css/xcage.css Could someone take a look at the source and CSS and try to tell me what I'm doing wrong? If it comes down to it, I'll even pay someone $10 via PayPal to fix the problem and create working code for me - in CSS. Thanks. this is my layout as of now http://72.232.208.44/new/ you can probally look at it and see what else needs to be done, its very close to completion. theres a div called "left-side-gradient" which is that small thing light bluegreenish line down the left side. right now how ti works is however long i set that line to be is how long the main content area is. which is backwards, i need the left-side-gradient line to be however long the main content div is. and the main content div needs to always stretch down to the bottom panel i've tried everything with all sorts of css variations and i can't figure it out. also i need to do the same sort of effect to the right-side-gradient. but im sure if someone tells me how i can fix the left side i can apply the same sort of rules to the right side. also the top banner portion and the lower content portion has this small gap in them. i can't seem to get that gap to go away either :/ (my html and css are w3 validated) HTML Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>page</title> <SCRIPT SRC="javascript.js" type="text/javascript"></SCRIPT> <link rel="stylesheet" type="text/css" href="stylesheet.css"> </head> <body> <div id="container"> <div id="banner"> </div> <div id="banner_under"> <ul id="float_ul"> <li><a href="index.html" onMouseover="lightup('pic1')" onMouseout="turnoff('pic1')"><img src="images/bHome.jpg" class="noborder" name="pic1" width="56" height="28" alt="Go Fast Gaming - Home"></a></li> <li><a href="services.php" onMouseover="lightup('pic2')" onMouseout="turnoff('pic2')"><img src="images/bServices.jpg" class="noborder" name="pic2" width="78" height="28" alt="Go Fast Gaming - Services"></a></li> <li><a href="contact.php" onMouseover="lightup('pic3')" onMouseout="turnoff('pic3')"><img src="images/bContact.jpg" class="noborder" name="pic3" width="73" height="28" alt="Go Fast Gaming - Contact"></a></li> <li><a href="controlpanel.php" onMouseover="lightup('pic4')" onMouseout="turnoff('pic4')"><img src="images/bControlPanel.jpg" class="noborder" name="pic4" width="113" height="28" alt="GO Fast Gaming - Control Panel"></a></li> </ul> </div> <div id="below_banner_container"> <ul id="float_ul"> <li><div id="top-left-gradient-extension"></div></li> <li><div id="top-middle-extension"></div></li> <li><div id="right-side-extension"></div></li> <li><div id="top-right-extension"></div></li> </ul> <ul id="float_ul"> <li> <div id="left_main"> <ul id="float_ul"> <li><div id="left-side-gradient"></div></li> <li><div id="content_area"><h2>Big Title</h2><br>stuffstuffstuffstuff stuffstuffstuffstuffstuffstuff stuffstuffstuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff stuff</div></li> </ul> </div> <div id="right_main"> <ul id="float_ul"> <li><div id="right-side-gradient"></div></li> <li><div id="right-side-text">falala f f f f f f f f f f f f f f f f f f f f f f f f f fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvvvv</div></li> </ul> <ul id="float_ul"> <li><div id="right-side-split"></div></li> </ul> <ul id="float_ul"> <li><div id="right-side-gradient"></div></li> <li><div id="right-side-text">falala f f f f f f f f f f f f f f f f f f f f f f f f f fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvv fvvvv</div></li> </ul> </div> </li> </ul> <ul id="float_ul"> <li> <div id="bottom_panel-upper"> textextextext </div> <div id="bottom_panel-lower"> text text text text </div> </li> </ul> </div> </div> </body> </html> CSS Code: BODY{background-color:#003333;margin:auto;} .noborder{border:thin none #000000;} .center_text{ text-align:center; } #float_ul{ padding: 0; margin: 0; float: right; } #float_ul li { padding: 0; margin: 0; display: inline; list-style-type: none; float:left; } #container{ width:750px; margin:auto; text-align:center; } #below_banner_container{ border:thin none #000000; border-spacing:0; margin:auto;; text-align:center; padding:0; width:750px; } /* END MISC CLASSES BEGIN BANNER CLASSES */ #banner{ border:thin none #000000; border-spacing:0; padding:0; width:750px; height:155px; background-image:url("images/GFG-topBanner_01.jpg"); background-repeat: no-repeat; } #banner_under{ border:thin none #000000; border-spacing:0; padding:0; width:750px; height:28px; background-image:url("images/GFG-topBanner_02.jpg"); background-repeat: no-repeat; } /* END BANNER CLASSES BEGIN EXTENSION CLASSES */ #top-left-gradient-extension{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:1px; height:30px; float:left; } #top-middle-extension{ border:thin none #000000; border-spacing:0; padding:0; background-color:#006666; width:500px; height:30px; text-align:left; vertical-align:top; } #right-side-extension{ border:thin none #000000; border-spacing:0; padding:0; background-color:#006666; width:49px; height:30px; background-image:url("images/right-side-extension.jpg"); background-repeat: no-repeat; } #top-right-extension{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:200px; height:30px; background-image:url("images/top-right-extension.jpg"); background-repeat: no-repeat; } /* END EXTENSION CLASSES BEGIN LEFT SIDE CLASSES */ #left_main{ border:thin none #000000; border-spacing:0; padding:0; background-color:#006666; width:550px; text-align:left; vertical-align:top; float:left; } #left-side-gradient{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:1px; height:400px; position:relative; } #content_area{ border:thin none #000000; border-spacing:0; padding:0; background-color:#006666; width:549px; text-align:left; vertical-align:top; background-image:url("images/left-side-gradient.jpg"); background-repeat: repeat-y; } /* END LEFT SIDE CLASSES BEGIN RIGHT SIDE CLASSES */ #right_main{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:200px; text-align:left; vertical-align:top; float:right; } #right-side-gradient{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:6px; height:100px; background-image:url("images/side-gradient.jpg"); background-repeat: repeat-y; position:relative; } #right-side-text{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:194px; text-align:left; vertical-align:top; } #right-side-split{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:200px; height:31px; background-image:url("images/right-column-split.jpg"); background-repeat: no-repeat; } /* END RIGHT SIDE CLASSES BEGIN BOTTOM PANEL CLASSES */ #bottom_panel-upper{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:750px; height:20px; font-size:13px; text-align:center; vertical-align:top; } #bottom_panel-lower{ border:thin none #000000; border-spacing:0; padding:0; background-color:#339999; width:750px; height:20px; font-size:11px; text-align:center; vertical-align:top; } I've got a problematic background DIV. It fills up the entire viewport and looks correct, but cuts off at the bottom (one screen height down) when I scroll. How can I get this DIV to span the entire height of the document, instead of just the height of the viewport? BTW, it works fine in IE 6, but cuts off in FireFox 0.9, Opera 7.5, and Netscape 7.1 Here's the code (you'll have to populate the content DIV to get scrollbars and witness the problem): Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> <!-- body { margin: 0; padding: 0; height: 100%; background-color: #F1EFE2; } html { margin: 0; padding: 0; height: 100%; } .bg { position: relative; margin-top: 0px; margin-left: auto; margin-right: auto; margin-bottom: 0px; width: 960px; height: 100%; background: #F7F6EF; text-align: center; border-right-color: #9E987F; border-right-width: 1px; border-right-style: solid; border-left-width: 1px; border-left-style: solid; border-left-color: #9E987F; } .heading { position: relative; margin-top: 0px; margin-left: 0px; margin-right: 0px; width: 100%; background: #7C2812; color: #F7F6EF; vertical-align: middle; text-align:left; padding-top: 10px; padding-bottom: 10px; text-indent: 10px; } .content { position: relative; top: 20px; padding-left: 15px; padding-right: 15px; width: 920px; vertical-align: top; text-align:left; } --> </style> </head> <body onResize="window.location.href = window.location.href;"> <div class="bg"> <div class="heading"> heading goes here </div> <div class="content"> content goes here </div> </div> </body> </html> Any help would be greatly appreciated! Fixed. Greets, I'm trying to get the follwing collumns to display on the complete height of the element they are nested in. Each of the 3 collumns currently only take the space required by the content that is in said element. Preview: The current layout is set with 3 divs (2 left floating, and the bigger one on right-float). I don't want to use tables/cells and I cannot use min-height as the content will be filled by the customer using a CMS. I Wish i could use something like: Code: #col_1 {height: parent.height;} here is a link to the actual page, please note that to use the style i am talking about you will have to use the top left select element and choose GH_02 -v. (this is my 1st attempt to have the same content with multiple css sets...) Is there a way that this can be done, basically I have a div hidden based on certain JS logic, but the amount of space of the content in the div is still taken up on the screen. I would like to make the div say 0xp and discard content. Is there any code that can help me, I've looked but can't find. Thanks Hi, I have a layout to build and I want to make it as accessibile as possible to the user. I therefore want to allow the user to be able to determine the site font sizes while also keeping the layout look as good as possible. The only way I have done this so far is by setting the width and height of other elements (div's mostly) using the em type. Is this ok? Or I am doing this totally wrong? Regards, Sim085 basically i want to span an absolute div 100% height and width to cover the whole browser window.. IE fails at this.. what are some methods used to get around this? Hey all, I need an area of content, defined by a div element. I would like it to have a minimum width of 550px, and a minimum height of 500px. However occasionally not everything will fit inside the box. Occasionally the box will contain a picture or word or flash file that exceeds 550px wide. When this happens, I'd like the box to be able to stretch to become wide enough to fit the big word/picture. Likewise when there is too much text, or a picture that is too long, I'd like the box to become tall enough to contain everything. My first attempt was using min-width and min-height. The height worked great, but since divs are block elements, the width would always be 100% instead of 550px. So I then tried adding "display: inline-block;". This made the width work, but now the text didn't automatically go to the next line when it reached the right of the box; instead, the box just increased in width. So to sum it up, I need something like this to have a width and height of 550/500: <div id="test">This sentence is small</div> But this one to stretch to the size required to contain the long word: <div id="test">adsfasdfasdfadfadfasdfasdfasdfasdfadsfasdfasdfadsfasdfasdfasdfasdfad sfasdfasdfadsfasdfasdfadsfasdfasdfadsfasdfasdfasdf</div> Hi, I have a page where I want to display some preformatted code inside a bordered box that has a fixed width/height with automatic scrolling. I can do this with a DIV + several css styles. However, when I generate the same file with Perl/CGI, The width/height stops working (at least not on my browser, Mozilla 1.1). Here is the file that works: Code: <html> <head> <style> .textarealike{ overflow: auto; border: 2px solid #0000FF; color: #000000; height: 30; width: 350; font-family: "Courier New"; font-size: 10pt; padding: 5px; } </style> </head> <body> <div class="textarealike"><pre> Some stuff Some stuff Some stuff</pre></div> </body> </html> and here is code that doesn't: Code: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <style> .textarealike{ overflow: auto; border: 2px solid #0000FF; color: #000000; height: 30; width: 350; font-family: "Courier New"; font-size: 10pt; padding: 5px; } </style> </head> <body> <div class="textarealike"><pre> Some stuff Some stuff Some stuff</pre></div> </body> </html> The only difference is the DOCTYPE header generated by the CGI script..... and I have no idea why this is: Can anyone help me out? Thanks, Frank |