CSS - Page Center - Slightly Off
Okay, because of a conflict with Sothink Menu Builder I cannot use the container or wrapper tag the way I normally would on my CSS. Instead, I've done this:
Code: * { margin:0; padding:0; } body { margin: 0 auto; width: 1000px; text-align: center; background-color: #e0d7e6; height: 100%; font-family: Arial, Helvetica, sans-serif; font-size: 12px; color: #000; letter-spacing: normal; vertical-align: top; word-spacing: normal; white-space: normal; line-height: normal; padding: 0px; background-image: url(../images/shared/gifs/bacgrnd.gif); background-repeat: repeat-x; } #wrapper { text-align: left; position: relative; z-index: 0; } And the HTML: Code: </head> <body><div id="wrapper"> webpage content </div></body> And it works well, except the page is off center (to the right) by a couple of pixels. It's in all browsers. Does anyone have a fix? Thanks in advance. Similar TutorialsBIO BIO CSS i would like for both the image and text to be centered on page-- they are just a little off.... am using FOX as primary browser -- but IE displays pretty much the same-- anyone got a fix for this??? its late and i have been over the coding a million times but just dont see the solution it right now thanks in advance! Alright... I give up on this one. The copyright moves up and down by a pixel or two between different pages. Go from the Home page to the Diabetes page and look at the footer and you will see. I have tried changing the margins, padding, and line-height on the text in the footer. I can get it to temporarily work but as soon as I change anything above the copyright (i.e. in the #content div) like line-height, add text, and etc it moves the copyright between pages again. Basically the content div is pushing down on the copyright differently depending on the amount of text that is in the article. Because other than the text all the articles pages code is exactly the same. All the footer text is a PHP include if that makes a difference. Thanks for looking at it because I have been working on this for quite a few days now and it is buggin the ba-jesus out of me? I have a theory, the footer (thats where the copyright is) is absolute positioned. Therefore it is taken out of the flow of the document. Could this be the cause of my problem? So if I were to place all the copyright and footer links within another div within the footer div would that bring those back into flow? Like if I gave that new div a position of static or something? Or is it out of the flow regardless because it's sitting inside of an absolute positioned div? Thanks a lot - here is the site in question Hi, I have a front page which is one image only, no text. The image is centered horizontally (i.e. a simply text-align: center; ). My question is - how do I centre it vertically? (no matter what the resolution of the website visitor is). i.e. Currently the image is at the top of my screen. I would like it to be in the centre, both horizontally and vertically. Many thanks! I have a div sitting on a html page that will be included in the main page. I include this page into a table and I would like the div to be centered horizontally inside the table cell. It isn't working for me at the moment. Am I doing something wrong? Here is what I have so far: Code: #mybox{ border-style: solid; border-width: 1px; border-color: #000000; padding: 5px; width: 400px; left-margin:auto; right-margin:auto; } Brad. I am trying to center this entire page, and it does show up centered in IE; however, after checking with BrowserShots.org, in all browsers other than IE, the header image is centered, but the rest is aligned on the left side....??!! Here is the page: http://www.georgiaspinal.com/indexTESTBR2.html Here is the CSS file I am using: Code: body {margin:25px; font:12px Verdana, Arial, Helvetica; } * {padding:0; margin:0} #wrapper { text-align: center; width: 770px; margin-left: auto; margin-right: auto; } .hidden { display: none; } .unhidden { display: block; } <div id="article" class="hidden"> Thanks for any help here!!! I have a single column layout with a fixed width (say, 700 px), centered in the window, composed of header, body, and footer divs in a wrapper div. I would like background images, left and right of the center column (two images, because they sort of fade up to the edge of the centerd div). How is this done? Is there a way to center the entire page using CSS? Reidy Fixed the problem myself. I added a strict doctype, and it fixed itself. Previous Issue: ------------------ I wrote out all the code to my website. However, everything is aligned to the left (default). In an attempt to center everything, I simply stuck everything into a <div> tag, and said this: Code: <div style="width:630px; margin: 4px auto;"> //My entire website </div> This solution works both with FF and Chrome, but not with IE. Any ideas? I'm trying to center a gridview on a page. Pretty straightforward. I just don't understand why this gridview will not center on the page. I have no other css. They instructions are left aligned fine. This is the code I have for the css. Code: #mid { text-align:center; } p.instr { text-align:left; color:Silver; } <div id="maincontainer"> <div id="mid"> <p class="instr">bunch of instructions</p> <asp:Panel ID="pnlMainMenu" runat="server"> <asp:GridView ID="GridView1" Runat="server" DataSourceID="SqlDataSource1"> </asp:GridView> </asp:Panel> </div> </div> Hello, I have the following code that creates a progress bar: Code: <style> table.meter { background: url("img/m_bg.gif") left center repeat-x; height: 13px; font-family: sans-serif; font-size: 11px; } table.meter td.mark{ background: url("img/m_mark.gif") right center repeat-x; } table.meter td.mark div{ background: url("img/m_l.gif") left center no-repeat; } table.meter td{ background: url("img/m_r.gif") right center no-repeat; } </style> <table cellspacing="0" cellpadding="0" class="meter" width="250"> <tr> <td id="mark" width="60%" class="mark"><div> </div></td> <td> </td> </tr> </table> This will make only image progress bar, but how can I write percents straight after table (on the right)? I need it to look something like this: <|||||||| > 60% But if I write "60%" after </table> tag, it will appear on the next line, and if I add another <td> to the table, it will inherit background from table.meter style and I don't need that. Hope somebody help me. Thank you in advance. In my first attempt at a heavily CSS-based layout, I've run into this frustrating problem. I currently cannot get IE to remove 2px around my search box and line up correctly. Example FF: Everything lines up perfectly. Example IE: You can see that the box around the search input is 2px lower than the box to the left. Here are the applicable classes: css Code: Original - css Code /* class for the div containing the search input */ .search { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; color: #000000; border-bottom:1px solid black; vertical-align:middle; background-color:#FFFADE; text-align:center; padding-top:3px; margin-bottom:5px; height:20px; } /* class for the input fields */ .inputbox { font-family : Verdana, Arial, Helvetica, sans-serif; font-size : 10px; color : #000000; background-color : white; border : 1px solid black; } /* for the containing table td */ #right_boxes { font-family:arial,helvetica,sans-serif; font-weight:normal; font-size:12px; width:145px; border-left:1px solid black; padding:20px; border-top:4px solid black; }
The HTML for this section: html4strict Code: Original - html4strict Code <td id="right_boxes" valign="top"> <form action="index.php" method="post"> <div align="left" class="search"> <input alt="search" class="inputbox" type="text" name="searchword" size="20" value="search..." onblur="if(ths.value=='') this.value='search...';" onfocus="if(this.value=='search...') this.value='';" /> </div> <input type="hidden" name="option" value="search" /> </form> <td id="right_boxes" valign="top"> I have tried everything that I can think of. Any suggestions or answers would be greatly appreciated. TIA, Conor Hello; i am trying to put a content of my page sit in the center of the my page it doesn't matter what browser is. but i just can do it for firefox, netscap and Opera browser, but i could not do it for IE browser. In the IE browser, my content of the page sit in the left side of the page. My IE file vision is 7.0.6 Could anyone help, thanks. my code as following: Code: <html> <head> <style type="text/css"> #container{ position: relative; width: 586px; /* width + border for IE 5.x */ w\idth: 580px; /* real width */ border: solid #036; border-width: 0 3px; margin: auto; } </style> </head> <body> <div id="container"> <p>Skip navigation</p> <ul> <li><a href="">Home</a></li><li><a href="">About</a></li><li><a href="">Contact Us</a></li><li><a href="">Site map</a></li> </ul> The Origin After getting back from his jaunt, Charles started work on his theory of evolution. Distracted by games of Reversi, Freecell and Solitaire on his computer, he took quite a while but then he heard that some Australian bloke named Wallace had come up with a similar idea so he got a move on to prevent his thunder being stolen. In 1858 Darwin and Wallance presented a joint paper to the Linnean Society of London that sent rumbles across the establishment and really quite upset a lot of people. The next year saw the publication of Darwin's 500-page 'abstract' - 'On The Origin of Species by Means of Natural Selection or the Preservation of Favoured Races In The Struggle For Life' (or OTOOSBMONSOTPOFRITSFL for short). </div> </body> </html> I have ads on the side of my website that when clicked open a div with a larger ad. The problem is that if a user has scrolled the page down and then clicks the ad, the div shows at the top of the page out of view, how can I fix this. I have tried position:fixed, relative and inherit as well as absolute but nothing works. Tim Every time I switch Web pages, the display starts at the far left and jumps to center. Is there a way to correct this and still allow for variations in screen sizes and resolution. http://www.madjazz.org/index.html http://www.madjazz.org/CSS/RobustLayout.css Thank you how do i center align table on page with CSS? Hi, Please help! I have multiple ul lists and I'm trying to float each list left and center on the screen all of them using css. I'm not trying to have an inline list. I'm trying to keep the three list, float left but center on the page. floating works but I'm having problems centering on the page. I have used margin-left and right:auto but because I'm using float left if stays on the left. Does anyone have any solutions. thank-you in advance Hi, Here's the site I'm working with: http://www.cjfusion.com I want to get that image centered on the browser window and then depending on how big the viewers screen is, the browser will cover up the left and the right. I hope that makes sense. I almost want it to be fluid, but I'm unsure how to do that. Ask questions if this doesnt make sense. Its hard to explain. -CJ |