CSS - Incredible Shrinking Page Elements
Hi,
I've been trying to integrate my blog into my website to look exactly the same. I am using the same style sheet for my blog as for the rest of my website. Somehow, my logo and fonts and pictures are all smaller on the blog than on the real site. I did a 'view source' and then pasted that into a file called test.php and testing different changes to my css from that file so it doesn't affect the rest of my site. The code is very similar between my regular site pages and my blog pages because I copied much of the header stuff directly into my blog template. I am totally perplexed as to the incredible shrinking page element dilemma. I'm not sure how much code to paste in here to get the best help. What do I need to provide you to help me troubleshoot? Any ideas? pe123 Similar Tutorialsi need to shrink a div to the width of the text inside of it, i have no clue how to do this, i know i can display:inline, but then the form that it in the div gets left out, and i know i can float: it, but i want it to be centered. how can i do this I'm testing this page in FF 3.6, so at the moment, I don't really care what doesn't work in IE. As you can see in the code below, my page consists of a couple wrapper divs around a menu and info area. I did solid color backgrounds in the code below rather than the images I've been using to make this simpler to look at. Essentially, the outer wrappers allow part of the background image of the inner wrapper to disappear when the window is too small. In addition to that functionality, I also want the info area to shrink when the window gets even smaller than that. As it is currently, that almost works--the two wrappers shrink when I get below their max-width, but the info area does not shrink until the window is well within its max-width. Here's the code: Code: <html> <head> <style type="text/css"> body{ text-align: center; } #container { background-color: red; max-width:990px; min-width:760px; position: relative; margin: 0 auto; } #content{ background-color: lightblue; max-width:990px; min-width:760px; margin: 0 auto; margin-left: -200px; padding-left: 200px; /**allows 200px of background to disappear when window too small**/ text-align: left; } #menu{ background-color: #ffffcc; width: 200px; position: absolute; left: -20px; /**allows hangover into disappearing background--no padding necessary since will be using img links**/ } #info{ border: #000 1px solid; max-width: 790px; min-width:560px; /**doesn't shrink when window below the max, even though container and content do**/ position: relative; left: 180px; /**width of menu plus menu left **/ padding: 5px; } </style> </head> <body> <div id="container"> <div id="content"> <div id="menu"> <img height="50" width="200" alt="link" /><br /> <img height="50" width="200" alt="link" /><br /> </div> <div id="info"> <img height="500" width="400" alt="picture" />Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. </div> </div> </div> </body> </html> Edit: I've found that if I make the menu relative positioned and position info absolute (and add top: 0px;) that I can get info to shrink properly. However, then the background from content is only as tall as the menu--which may or may not be shorter than the content in info. If I make the height of content 100% it looks ok, but not the way I'd like it to look. I can live with the extra background under the words in the case where there isn't enough to fill the whole height of the window, but if the window isn't tall enough for all the stuff in info, the background doesn't extend down far enough. Thanks for any ideas! 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 I just figured out how to make a cool navigation bar with css, but adjusting the links in the bar also changes the style of all my other links on the page. Is it possible to have two sets of link styles, one that only applies on the navigation bar and one that only applies on my other text? The navigation bar and text each have their own div, if that helps at all. How would you go about this? Below is a sample of my CSS page, I'm having an issue with the floats that are commented out, they are affecting my th even though I haven't actually classed anything in my html... Any ideas? <code> /* CSS Document */ body { margin: 0; padding: 0; background-color: #000; color: white; font-family: "Lucida Grande"; font-size: x-small; } table.outer { border:1px solid #fff; width: 178px; } /*.left { float: left; } .right { float: right; }*/ table { clear: right; width: 700px; line-height: 1.4em; border-collapse: collapse; border: 1px solid #000; color: white; background: #000; font-family: "Lucida Grande"; font-size: x-small; }</code> Hi, Can somebody help me to style elemnts on the page using % as unit of measurement & relative positioning so they'd look like -- - 20% - -- - 80% - +----------+----------+ | Element3 | Element1 | +----------+----------+ ----------- | Element2 | ----------- +----------+ ----------- | Element4 | ----------- +----------+ or even better like -- - 20% - -- - 80% - +----------+----------+ | Element3 | Element2 | +----------+----------+ ----------- | Element1 | ----------- +----------+ ----------- | Element4 | ----------- +----------+ The html can be as simple as Code: <div id="Element1">Element1</div> <div id="Element2">Element2</div> <div id="Element3">Element3</div> <div id="Element4">Element4</div> Hi. I have a question about how to edit specific elements in a profile page. Take this as an example; worldwideweb.teenspot.com/profiles/Mumfie Scroll down and look at the box named "Specifics". Lets say I want to edit "Location" in that section from Norway to Sweden by using CSS. What is the procedure I should follow? The page allows you to edit CSS in an advanced page editor. Should I search up the source for that page and do some modification by pasting a new code? Ok well the boss asked me to do a XHTML/CSS version of the website and get it up to snuff with web standards. Now I've done the coding to get the site to look the same in XHTML as it did before in HTML and tables... but there is one catch. I can't quite get my head around the easiest way to deal with captions underneath pictures. For example look at this page: http://www.zeroonedesign.com/aboutus.html Now in my version I haven't got the picture of the guys, or the "navigating our portfolio" bit. Take a look at my version he http://obelix.ca/zeroone/aboutus.html I was thinking about creating little block divs and positioning them absolute on the page... but that doesn't seem like much of a solution as I could see the stylesheet growing considerably if there was a page with a lot of these pictures with captions. Any reccomendations? How do you guys do captions with pictures? I'm working on a site with a div element with a fixed position, some 800 pixels from the left. The site is optimized for 1024x768. However, if a user with a resolution of 800x600 views the page, this div element will be missing, and the user won't be able to scroll over to see it. Is there some way I can get around this? One idea would be to align the div on the right instead of the left, but I don't want a lot of whitespace between my content (on the left) and my div (on the right). I was hoping that I could specify a parent element with a relative position, and that position: fixed would reference the position of the parent element, but that only seems to work when the child div element is position:absolute, not position:fixed. Thanks for any insight. Hello, Here's a link to a very short video (MOV format) showing the issue that I'm having. I'm guessing that it's CSS related. It seems like the screen update shouldn't be so obvious. The graphics involved are very small, as well. What could be causing this? Thanks for any help! blendernewbies dot com slash tmp slash screen_update_issue dot mov EDIT: well, it seems I can't post links! How am I supposed to accurately convey the issue without wasting people's time trying to describe it? Sigh. I will try to post the link in a written out format. I hope it doesn't violate anything doing it that way. The video is hosted on my own server and is about 800KB. Thanks. Hello all, I'm having a bit of trouble with a list of relative, floated <li> elements, each containing a single absolutely positioned div that appears on hover. I'm using the :hover pseudo-class currently but I will use JavaScript for IE6 once it displays correctly. The code is below. The problem is that the <div> appears on top of it's parent element but behind all other elements. Code: #wrapper-body ul.staff-list{ list-style-type:none; padding-top:10px; position:relative; } #wrapper-body ul.staff-list-team{ width:313px; padding-top:0; padding-bottom:15px; margin-bottom:20px; border-bottom:1px solid #d7e3a9; } #wrapper-body ul.staff-list li{ float:left; width:230px; position:relative; padding:8px 0 8px 15px; z-index:1; } #wrapper-body ul.staff-list-team li{ width:151px; padding-left:0; padding-left:5px; } #wrapper-body ul.staff-list-team li.right{ padding-left:5px; } #wrapper-body ul.staff-list-clerks li{ float:none; width:310px; padding-left:5px; } #wrapper-body ul li.highlight{ background-color:#f4f6ec; } #wrapper-body ul.staff-list li p{ padding:0 0 9px 0; margin-left:91px; } #wrapper-body ul.staff-list li small{ padding:0 0 5px 0; margin-left:91px; } #wrapper-body ul.staff-list-clerks li span{ color:#A6302B; display:block; float:left; } #wrapper-body ul.staff-list-clerks li span.clerk-name{ width:140px; } #wrapper-body ul.staff-list-clerks li span.clerk-phone{ width:120px; background:url(../img/structure/clerks-phone.gif) 0 2px no-repeat; padding-left:23px; } #wrapper-body ul.staff-list-clerks li a.clerk-email{ display:block; float:left; height:16px; width:16px; background:url(../img/structure/clerks-mail.gif) 0 3px no-repeat; } #wrapper-body ul.staff-list li div.staff-list-detail{ display:none; background:url(../img/structure/staff-list-bottom.gif) left bottom repeat-x; padding-bottom:3px; margin-top:-15px; left:4px; z-index:10; top:15px; position:absolute; } #wrapper-body ul.staff-list li div.staff-list-detail a{ background:url(../img/structure/staff-list-bullet.gif) no-repeat 0 4px; padding-left:8px; } #wrapper-body ul.staff-list li:hover div.staff-list-detail{ display:block; } An image of what is happening below: Thanks for reading! I'm making a webpage for myself, and am coding to current Transitional XHTML and CSS standards. I'm using Firefox 0.9.2 for viewing the page. The problem I'm having is with adding a class to a <td> element and getting it to work correctly in IE 6. The CSS class I'm using for the <td> element is as follows: Code: .w3type{color: black; background-color: #FFCE6B;} Code: .w3type:hover{color: white; background-color: red; background-image: url(images/mrgreen.gif); background-repeat: no-repeat; background-position: right;} I add this class to a <td> tag: Code: <td class="w3type"> and when i view it in FF, the text and background work correctly, changing color and adding a little image to the right when I hover my mouse over it. The problem is that when I go to view the code in action with IE 6, neither the background nor the image will appear on hover. Is this a problem with IE, or my code? If you want to see the code on my site, here's the link. The css formatting in question is on the lower left corner of the page (the W3C webbadges). Thanks for any help Interesting situation i have. In my css i have this declared Code: css a:link, a:visited { color: #c97c0f; text-decoration: none; font-weight: bold; } a:active, a:hover { color: #82581d; text-decoration: underline; } div#buenprov_content a:link, a:visited { color: #644e14; text-decoration: none; font-weight: bold; } div#buenprov_content a:hover { color: #35290a; text-decoration: underline; } For a change, IE displays the link colors correctly, the ones inside the div with the id buenprov_content have the color i want them to, and the rest of the page has the ones that are global. However, in firefox, they all inherit the traits from the #buenprov_content Even links not inside divs with that ID.... as shown: Here ( The ones in the fading content should be a different color ) Im building that site for a restaurant...but anyways, im a bit stumped as to why FF is doing this...any help? Thanks. Firstly, I'd like to say that I've been browsing this forum for a while now, as well as sites such as w3schools, and I've found it all to be very helpful. But now I have a situation that I haven't been able to solve on my own. Essentially, I want to make a clear and simple CSS-based layout that will work across browsers and platforms. I use a Mac myself, and it's difficult for me to check for problems with Internet Explorer. The problem I'm currently having concerns layout and positioning. Here's a link to the splash page I'm working on for a student organization: http://individual.utoronto.ca/ghp/fasu2006/ Before I make the full site I want to work out layout troubles I've been having. I got on a PC and the text when viewed with IE did not seem to properly align within the opaque white box I made for it. I've been feeling a little overwhelmed with concepts of absolute vs. relative positioning, unit values such as percents, px, em, and making use of things like padding, margins etc. and I'm hoping I can get some advice. So in one sentence, here is my question: How can I position elements (text, divs, images, anything) on the screen using CSS in an efficient way that will produce a similar result in different browsers? Here is the code that I think is relevant: Code: p {font-size: .75em; font-weight: bold; margin-left: 12em; margin-top: 8em;} #content {margin-top: 10px; margin-bottom: 10px; margin-right: auto; margin-left: 3em; width: 800px; padding: 20px; background: transparent;} #overlayback {position: absolute; top: 8em; left: 15em; width: 250px; height: 250px; z-index: 0; filter: alpha(opacity=80); opacity: .80; background: #FFF;} #overlaytext {position: absolute; top: 3em; left: 15em; z-index: 1;} h1 {font-size: 6em; margin-left: .1em; margin-top: .75em;} h2 {font-size: 1em; font-weight: normal; margin-left: 9em; margin-top: -4.5em} </style> </head> <body> <div id="content"><img src="images/tower.gif" width="297" height="422" alt="tower"> <div id="overlayback"></div> <div id="overlaytext"><h1>fasu</h1> <h2>2006-2007</h2> <p>coming soon</p></div> </div> I hope I've been clear and thanks in advance for any advice. It's very much appreciated. Hello, I have the following css css Code: Original - css Code ul#menulist{ position:relative; top:0px; list-style-type:none; margin:0; padding:0; } ul#menulist li{ background-color:#717100; display:inline; margin:0; padding:0 10px; border:0; height:30px; } ul#menulist li a{ text-decoration:none; margin:0; padding:0; border:0; }
A gap is appearing between <li> elements in Opera and FF but not in IE. You can check it here Which is the correct behaviour? How do I remove the gaps between <li> elements in a valid way. Thank you. I'm trying to learn CSS. I've taken great pains to get everything right. My pages all validate and they look correct on Firefox and mostly correct on Chrome. However IE is all over the place. If you view the below pages side by side on Firefox and IE, the following occur (in order of importance): - the top main box is pushed below where the left boxes end - the upper-right drop-down stuff is totally off in the weeds (Chrome also looks like IE) - "Recipes" tab isn't borderless on the bottom edge - left boxes are the wrong size and push "Clear List" out of bounds - search button is off in relation to search box mcrackan.com/recipes/csstest.htm mcrackan.com/recipes/css/default.css (Sorry about the non-links. I'm apparently not allowed to post click-able links yet.) Can anyone point me in the right direction for whatever I'm doing wrong? - Dinah I'm currently customizing a theme for a Drupal site and am having a bit of an issue with background images on some content. I have 1 class and an HTML element that I'm trying to apply the style to. I have a non-repeating background applied to the title class which is positioned to the left of the area. The second is a background I'm attempting to tile across the x-axis of the h2 element. This second background does not show while the first one is showing. Is there a way around this? I'm assuming that because it's the same element, I won't be able to get away with this and will have to find another solution. Here is my HTML Code: <h2 class="title"><a href="/drupal/node/1">Welcome to the Caustic Guild!</a></h2> CSS Code: #mcol .title { background: url(/drupal/themes/caustic/images/icon_post.gif) no-repeat 0px 2px; } #mcol h2{ background: url(/drupal/themes/caustic/images/mcol_head.jpg) repeat-x; margin: 0px 0px 0px 0px; padding: 2px 0px 6px 35px; font-size: 180%; letter-spacing: -1px; text-align: left; border: 3px solid #78788a; } Hi guys, I don't know if this is possible.. I have a table with position: fixed and width: 100% height: 100% so it covers the entire screen. There is text behind it, you can see through the table and there is text back there. My problem is you can't click on anything in the background, behind the table. You can't select the text and you can't click the links because the table is blocking them. So my question is it possible to click through the table element on the links in the background and stuff? http://perfbase.com/beta/tablesector/v7/ I tried setting the middle td to visibility: hidden and display: none but that didn't work. I tried javascript events but click, mousedown, mouseover, none of them work for the text in the background. Thanks a lot! Hi guys, could you help me out with following issue: See this Picture for better understanding: http:// picasaweb. google.se/lh/photo/e446yLNWr_eTqkiwPK0-CA?feat=directlink WHat i have is a div container (mainContent) In which i have some text in a Paragraph <P> and in the middle of this <P> i am trying to make a box which will contain a list of links. Have no clue how to achieve this. My idea would be: <div id: mainContent> //text//<div style="???"> //Link//<div style="float:right; DONT Know how to lower vertically??"> Good ideas for where i can find a solution? I don't know if that is what one would call this topic...but I'm having a lot of trouble understanding "referencing elements" in CSS. for example what is the difference between: Code: ul li { } and Code: li ul{ } Or let's say I have: Code: <div id="bottom"> <a id="copy" href="http://www.whatever.com">Whatever</a><br> <a class="credits" href="http://www.anothersite.com">Another Site</a><br> Some other random text </div> What is the CSS to reference the link with id="copy"? or the link with class="credits"? Many menus use nested <ul>s and <li>s and have IDs or classes for them as well. I'm very confused as to the syntax to reference an <li> in a <ul> as opposed to a <ul> in an <li>. Anyone have links to some documentation on this? |