CSS - Appreciate Any Help - Min-width Smaller Than Image Width.
I have a header div with a background image - it's basically a pair of hands holding a banner - the arms extending to the sides of the window.
I'm trying to work it so that, no matter how wide or thin the window, the arms will always extend to the sides. So when you make it smaller, the image will disappear beyond the viewing window. This happens automatically on the right-hand side, but the image is stopping it on the left. Is there a way to set a min-width, which is smaller then the image itself, so that when the window is shrunk the image starts to disappear on either side until it reaches the min-width? I'm trying to get it so the arms will disappear and stop at the hands. Or can anyone suggest an alternative solution? I tried to do it with background and header image, with the arms on the background, so when the top image moves it looks like the arms move with it. That worked great until I started using a patterned background. Full width: |---------------------------------------| |AAAAAAAAHHH BBBBBBBBBBBBBB HHHAAAAAAAAA| |---------------------------------------| Shrunk width: ------- |------------------------| -------- AAAAAAA |AHHH BBBBBBBBBBBBBB HHHA| AAAAAAAA ------- |------------------------| -------- Grey bit outside window edge. | Window side A Arms H Hands B Banner I hope that makes sense. I expect there's an easy solution but I've been trying to figure it out for several hours and could do with someone else's perspective. Thanks. Similar TutorialsHi, 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.... i ve been playing with my page and been trying to modify the width of the page (divs) according to the browswer's width. The problem is i want the navigation menu on left to be fixed width (say 200px) and the center div and the right column to be variable width. Also, i want to set a minimum width , so that the floating divs dont roll below the navigation menu. here s the link to the page. try reducing ur browser windows size . the content div rolls down under theleft nav menu. http://ccc.1asphost.com/pacemakerpr...r/cicuitlab.htm Also , i get wierd result in netscape navigator. please help I have an absolutely positioned <div> containing a block of text. I have not specified a width for this <div>. This <div> is nested within another <div> for which I have specified a width of 200px. So something like: html4strict Code: Original - html4strict Code <div style="position: relative; width: 200px;"> <div style="position: absolute; top: 10px; left: 20px; z-index: 100;"> Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Curabitur eu purus a tellus mollis consequat. Phasellus aliquam sapien quis mauris. </div> </div> <div style="position: relative; width: 200px;"> Since the absolutely positioned <div> is not part of the page's normal flow, I would expect that its width would expand according to its contents (and the browser window's boundries). Instead, in Firefox only, the width of the absolutely positioned <div> expands only to the width of its parent - in this case 200px. Am I doing something wrong? or is there a workaround for this? I have seen a design which I find pretty interesting where in the main site is aligned left and fixed width at say 700px wide. Yet the footer seems to span the entire screen. The header also seems to use the entire screen width but that is beign accomplished with the background image, but this footer goes all the way to end of the screen and naturally adjusts itself under all the content. Is there a way to get this effect? 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 Hello, (please also see attached/uploaded style sheet) I'm puzzled why (in the following code) the TEST #2 table renders as required (i.e. 2 rows in 1 column, all with the same cell WIDTH) but the table in TEST #1 seems to render the table cells (i.e. 2 columns in 1 row) without a common cell WIDTH. How can I get all the cells (there are plenty more!) in table TEST #1 to all be exactly the same width (preferably 85px)? Code: <link rel="stylesheet" type="text/css" href="http://thinet/cgi-bin/thinetStyleSheet.css"> TEST #1 <table class="menu" border=1 CELLPADDING=2> <tr> <td class="pinkButtons"><a title="Treats menu" href='http://thinet/theread/forumdisplay.php?s=&forumid=82'>Treats</a></td> <td class="pinkButtons"><a title="New Starters, Leavers and Transfers" href='http://thinet/theread/forumdisplay.php?s=&forumid=41'>Joiners etc.</a></td> </tr> </table> <P> TEST #2 <table class="menu" border=1 CELLPADDING=2> <tr><td class="pinkButtons"><a title="Treats menu" href='http://thinet/theread/forumdisplay.php?s=&forumid=82'>Treats</a></td></tr> <tr><td class="pinkButtons"><a title="New Starters, Leavers and Transfers" href='http://thinet/theread/forumdisplay.php?s=&forumid=41'>Joiners etc.</a></td></tr> </table> I don't think I've quite grasped the idea of CSS yet?!?! Any help/pointers would be appreciated. Thanks, Andy Ok. Here's the problem: I have a asp.net 1.x datagrid inside a floated div and I want the datagrid to stretch the width of the div. This div is in the center of two other floated divs. Is there a way to make a table go 100% the width of its container div? Css code: Code: /* left bar: */ #navBar{ width: 185px; float: left; } /* right bar: */ #rightModulesContainer { width: 130px; margin: 0; padding: 0px 0px 0px 10px; float: right; } /* center content: */ #content{ padding: 0px 5px 0px 0px; margin-top:0; margin-bottom:0; margin-left:4px; margin-right:0px; float: left; text-align:left; /*display: inline;*/ } /* contained in #container: */ #dataGridContainer{ margin: 0; padding-bottom: 10px; min-width:360px; } .categoryGridStyle { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 10px; font-style: normal; color: #000000; width:100%; } and here is the layout of the divs: Code: <div id="navBar">left navigation bar here (tree view)</div> <div id="rightModulesContainer">right side bar here</div> <div id="content"><div id="dataGridContainer">datagrid here</div></div> Thanks for your help in advance. I've been messing with this for a while - trying to get it to work cross browser is driving me nuts. I've tried placing the divs in containers and floating the containers, I've tried everything I can think of... I have a page with an ASP.NET Gridview on it...this Gridview is located in a child DIV inside a parent DIV. That Gridview can often go wider than the parent DIV width set. In IE6 the MAINDIV (Parent DIV) would expand to fit the expanded Gridview contained within the child DIV. In IE7 the DIV will not expand so it overlaps the DIV and looks bad. I want that MainDiv to dynamically grow with the child DIV width, like it did in IE6. Please see my code below. I want the MainDiv to remain ~800px unless it is pushed out further. Thanks for any ideas on a fix for this. Whenever I try min-width it just blows the parent DIV out to 100% screen size. Code: <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> </head> <body style="width:100%;text-align:center;background-color:#68838B" onload="loadpage();"> <form id="frmMain" runat="server"> <div id="mainDiv" style="position:relative;top:10px;width:800px;height:auto; background-color:white;border:solid 1px #666666"> <div id="contentDiv" style="text-align:left;width:797px; padding:3px 3px 3px 3px;"> <asp:ContentPlaceHolder ID="contentBody" runat="server"></asp:ContentPlaceHolder> </div> </div> </form> </body> </html> Trying to delete my post but no option to delete so just removing content. I'm trying to set up a box to hold an image and a caption. I thought it would be really easy, but I'm having huge difficulties... Here's what I want: A floating box contains my image and caption. It shrinks to fit the image width (which varies depending on the image), and the caption wraps onto new lines if needed. Simple, eh? Well, apparently not... I just can't get my text to wrap. If the line of text is longer than the image, it stretches the whole container. No matter how many workarounds I try! Can someone please tell me how it's done using CSS?! I'm trying to set a background image that spans from edge to edge in my browser window. Currently, I have everything set up and positioned as I'd like, but the image stops just short of reaching the very edges of the browser window on the left and right sides. The image itself is 2000px wide, so that various browser widths show the continuation of the image. You can see the problem I have at URL Notice the blue lines on either side aren't quite making it to the edge of the browser. The relevant CSS is located at URL The .main div at the bottom is the one with the background image code. Thank you for any help offered. Hi, I have a background image that I want to incorporate into the header div of a fixed width layout. The header is of a gradient style - on the left it is a solid color and as you move along towards the right it fades to white. The image is 981x76. If I bring it into Gimp, I can scale it to 1920 x 76 and it looks the same. I would like to be able to do that in a div tag, with the image as a background. I would like the image to scale horizontally just like I can do using Gimp. Is this possible? Basically, I want the browser to manage the scaling of the image. 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 Internet Explorer always presents me with a challenge (partial repost). The current issue involves emulating max-width in IE using the technique described by Svend Tofte. http://www.svendtofte.com/code/max_width_in_ie/ The CSS code uses JavaScript expressions and feeds the browser's width to the style. The CSS code follows. * html #Content { height: 1%; width:expression( document.body.clientWidth > (500/12) * parseInt(document.body.currentStyle.fontSize)? "30em": "auto" ); } This implementation resizes and displays the fluid width in IE. But it does not emulate the max-width property. Basically, I need help fixing the max-width implementation on #Content. Since max-width remains a challenge in IE, the min-width remains a greater mystery. Min-width would be nice as well. The page is complex with several wrappers for other IE display issues and JavaScript functionality. Presently, these workarounds and hacks have my head spinning. The page has an overall wrapper #Container. #Content div has the max-width expression. It encases #div.bgWh, so the page could have true transparent round corners. One issue relates to how div.bgWh expands beyond #Content when the client's browser width approaches 260 pixels. These containers serve a purpose; but IE does not deal with their width in a predictable manner. Fortunately, Firefox does not have these issues. These scenarios leave me scratching my head more often than not. Overflow hidden property has worked for me in the past, but did not provide the magic bullet this time around. Please load the page and shrink you browser to around 260 pixels. Keep your eye on the round corners around the main content area. The container, div.bgWh, expands beyond #Content. Please let me know if you see any relevant patterns and if you have any useful suggestions on implementing max-width. Somebody may suggest better approaches to the IE max-width conundrum. http://neville.f2o.org/nifty_TEMP1.html Styles in Question #Content div.bgWh #Container I'm writing a modification for a bulletin board. One of the beta testers had a problem with their template... My modification uses a left & right float, with a clearing div at the bottom with a copy right. I know the problem, but my question is, why is it a problem: width="75%" will sometimes, in certain templates, make the right floating table drop down beneath the left floating menu, and it's width is 100%. When I change it to inline styling, style="width: 75%;", it works as it should. I'd really like to know why it's doing this, because I've never ran into this before. Here's a slimmed version of the HTML/CSS: Code: <div id="st0re_wrapper" style="float: left; width: 24%; clear: both;"> <table class="borderwrap iptable" cellpadding="3" cellspacing="2" width="100%"> <tr> <td colspan="" class="maintitle"><p>Your Menu</p></td> </tr> <tr> <td style="padding-left: 5px;" valign="middle"> <div style="margin-left: 5px;"> Sample menu item. </div> </td> </tr> </table> </div> <table class="borderwrap iptable" style="float: right;" cellpadding="3" cellspacing="2" width="75%"> <tr> <td colspan="" class="maintitle"><p>Sample</p></td> </tr> <tr class="row2"> <td valign="top" width="100%"> Sample content. </td> </tr> </table> The used CSS classes a Code: .ipbtable { width: 100%; } table.ipbtable, tr.ipbtable, td.ipbtable { background: transparent; color: #222; font-size: 10px; line-height: 135%; } .ipbtable td, .divpad { padding: 5px; } .borderwrap, .borderwrapm { background: #edede7; border: 1px solid #91908B; color: #55554F; padding: 0px; margin: 0px; } .borderwrapm { margin: 5px; } .borderwrap h3, .maintitle, .maintitlecollapse { background: url(style_images/convention/maintitle.gif); color: #f6f4ef; font-size: 12px; font-weight: bold; margin: -1px; padding: 7px 7px 7px 12px; } .maintitle td { color: #EEEDE8; font-size: 11px; font-weight: bold; vertical-align: bottom; } .maintitlecollapse { border: 1px solid #FFF; } .maintitle p, .maintitlecollapse p, .formsubtitle p { background: transparent !important; border: 0 !important; margin: 0 !important; padding: 0 !important; } st0re_wrapper is just an unused id, besides the inline styling. Code: <tr class='firstrow'> <th width=10%><strong>Rank</strong></th> <th width=40%><strong>Site</strong></th> <th width=25%><strong>In</strong></th> <th width=25%><strong>Out</strong></th> </tr> that makes it exactly the way i want, but when i switch to Code: <tr class='firstrow'> <th style='width=10%'><strong>Rank</strong></th> <th style='width=40%'><strong>Site</strong></th> <th style='width=25%'><strong>In</strong></th> <th style='width=25%'><strong>Out</strong></th> </tr> it is sized naturally. I'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 - I'm a bit of a noob when it comes to CSS etc. but have been asked to modify some code for someone. Basically it's a simple site that has the main content centered on the screen (about 960px wide). However there is a large banner image that is about 2000px wide that is supposed to stretch as wide as say a large 27" mac. I am not sure if this is the correct way to do it but I guess they couldn't use a smaller image and repeat it because there is a unique design/pattern throughout the whole width. Anyway, on smaller browsers everything looks good except the horizontal scroll bar allows the user to scroll all the way to to the right. Is there anyway to clip the image on the top to prevent the scroll bar from showing based on screen width? Hope that makes sense. Thanks. I am trying to teach myself doing a tableless website using css and I am starting with header then working my way down I spent all day trying to serach a way to stop the right end image cap to jump down the next row when firefox width browser is shrinked down but it doesn't do that in IE .. Here the url http://www.prismaze.com/ it showing only the header right now and it what I am having issue with .. there are 3 images in it .. left and right and the background .. Here the html and css <body> <div id="logoheader"> <img src="templates/stlaware/images/stlaware_01.png" width="548" height="90" border="0" align="left" /> <img src="templates/stlaware/images/stlaware_05.png" width="55" height="90" border="0" align="right" /> </div> </body> </html> ------------------------ the css ------------------------ body { margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; background-color : #FFFFFF ; } #logoheader { background: url(../images/stlaware_03.png) repeat; height: 90px; width: 100%; } How do you stop image on the right side of the header (stlaware_05.png) from wrapping to the next row if Firefox browser is sized down in width? Thanks .. Bill 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 |