CSS - Css Align Center With Float Right Problem Safari
I am trying to get a 2 column layout to work across all browsers and I ran into a strange problem with center in Safari (or what Safari looks like according to the screenshot at http://www.snugtech.com/safaritest/)
The page aligns correctly in my version of IE and Firefox. What I want to happen is for the table to center in the content div "image_block." In Safari the table is centering inside the container div "container" and sometimes behind the float right div "thumb_block." you can see it live at link here is the code Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>images</title> <BASE href="http://jasonhalac.com/picture_gallery/"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <link href="/imagerollover.css" rel="stylesheet" type="text/css"> <link href="images.css" rel="stylesheet" type="text/css"> </head> <body"> <div id="top_image"> </div> <div align="left" id="list_tabs">header content</div> <div id="container"> <div id="thumb_block"> thumb block float right fixed width thumb block float right fixed widththumb block float right fixed widththumb block float right fixed widththumb block float right fixed widththumb block float right fixed widththumb block float right fixed widththumb block float right fixed widththumb block float right fixed widththumb block float right fixed widththumb block float right fixed widththumb block float right fixed width widththumb block float right fixed widththumb block float right fixed widththumb block float right fixed width widththumb block float right fixed widththumb block float right fixed widththumb block float right fixed width widththumb block float right fixed widththumb block float right fixed widththumb block float right fixed width widththumb block float right fixed widththumb block float right fixed widththumb block float right fixed width</div> <div id="image_block"> <p>image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block</p> <table width="200" border="1" align="center"> <tr> <td> </td> <td> </td> <td> </td> </tr> <tr> <td> </td> <td>test</td> <td> </td> </tr> <tr> <td> </td> <td> </td> <td> </td> </tr> </table> <p> image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image block image blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage blockimage block</p> </div> </div> <div id="tipDiv" style="position:absolute; visibility:hidden; z-index:100"></div> </body> </html> and css Code: #container{ margin: 0px; border: 0px; height: 600px; width: 915px; } #thumb_block{ width: 310px; margin: 0px; padding: 0px; float: right; } #image_block{ margin: 0px; padding: 15px 0px 0px 0px; } Similar TutorialsHi when i use this in my css file Code: div.head { width: 100%; border: 1px dotted black; align: center; } and place an image within the div using head class. it doesn't put the image in the center of the div. however if on the page i use Code: <div class=head align=center><img src='pic.gif'></div> it does work. can anybody guide me please why the align attribute doesn't take affect from css file? thank you hi.. I have created a site. I want to put all the content in the center of the screen. so I have written the code: <body> <table align="center"> <tr> <td align="center"> Here goes all the content + menu+ logo+ banner </td> </tr> </table> </body> It is working fine for some pages like home ,aboutus but for every other page content is not in the center. please help me on this. Sorry i can't paste the code for each page so i am giving the link of website renukainstitute.com I am relatively new to using div tags - transitioning from table tag to organize pages. I want the checkboxes to be aligned to the left inside a container that is centered in the body. Currently it is all aligned to the left for some reason. The body tag has no text-align or any other css rule manually set. Code: <div style="display: block;text-align;left;float: center;margin-left: auto;margin-right: auto; border: .1em solid;width:400px; position: relative; clear:both;"> <div style="display: block;text-align;left;float: left;margin-left: auto;margin-right: auto; border: .1em solid; position: relative; clear:both;"> <INPUT TYPE="CHECKBOX" NAME="cartoon">cartoon<BR> <INPUT TYPE="CHECKBOX" NAME="comicstrips">comicstrips<BR> </div> </div> thanks. Firefox: all looks fine except the checkbox container does not appear to be inside the surrounding container - the outer container div appears as a line (it's border) at the top of the inside div with the checkboxes IE8: on a test page with nothing else - appears as Firefox. In my page with several other divs it appears with one container inside another fine, but the main container is not centered. I have looked at several tutorials about float etc but...wits end... thanks. I'm trying to convert a table based site into using css. I'm however running into small problems. For example, I have the following table Code: <table> <tr> <td><image></td> <td><another image></td> </tr> <tr> <td align="center">1992</td> <td align="center">2005</td> </tr> </table> I can convert it in the following way Code: <div style="float: left"><image><br />1992</div> <div style="float: left"><another image><br />2005</div> My problem is that I need the table itself is center aligned, so how do I get the divs center aligned as well? This won't work Code: <div align="center"> <the two divs> </div> Another problem is convering the following table into using divs Code: <table> <tr> <td rowspan=2 valign=middle><image></td> </tr> <tr> <tr> <td><image></td> <td><another image></td> </tr> <tr> <td rowspan=2 valign=middle><image></td> </tr> </table> Any help is appreciated - Kimppa I want to align the links and such long box on the right, but I don't want to use float because then it won't push down the footer on the page accurately if you know what I mean. Thanks.. http://www.innerspect.net/blog/ How? I want to be able to do it from my stylesheet. Thanks guys. I've tried the usual trick of setting the width and margin-left and right to auto but it just doesnt work. If someone could please help with this, that would be great. This is all the code in my css file as of now, i'm using an img tag as my bacground incase people were wondering, so that it would resize to fit the window. the #content block is the one that i'm referring to. css Code: Original - css Code body { font-family: Verdana, Tahoma, Arial; color: #FFFFFF; text-align: center; margin-left: auto; margin-right: auto; } .bg { width: 100%; position: absolute; top: 0; left: 0; z-index: 5000; } #content { width: 800px; height: 600px; top: 0px; left: 0px; position: absolute; z-index: 6000; border: 1px solid #FFFFFF; margin-left: auto; margin-right: auto; } .nav { background-image: url('images/blank.jpg'); background-repeat: no-repeat; } a:link { text-decoration: none; color: #0066CC; font-size: 9px; } a:hover { text-decoration: underline; color: #0066CC; font-size: 9px; } a:visited { text-decoration: none; color: #0066CC; font-size: 9px; } a:active { text-decoration: none; color: #0066CC; font-size: 9px; } body { my entire page's body is contained in a div. the width of this thing doesnt change. i want to keep the page on the center of the browser widow. i tried <div align=center>...... but this aligns the contents of the div and not the div itself. please help hello i have this style in a css file.... .subheadinginvgreen { font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 13px; color: #006666; font-weight: bold; sline-height: .2em; align:center; } somehow when i apply it to a div tag, it does not center the text...e.g. <div class="">test text</div> Hi all, I have a layout where I have a banner at the top and I want the column below it to align in the center of the page, like this ... How can I do this? Also, can someone tell me how to make the top banner column fill the whole width of the page? Thanks. My new site can be found at http://www.rockapedia.co.uk/index2.php It works exactly how I want it in Firefox but IE doesn't appear to centre the whole page. Can someone advise please. I have a row of icons (for navigation, with a text description underneath them) I am trying to break out of table design so I want these divs aligned next to each other, with the image/text centered. Everything looks pretty peachy... but in FF the text such as "Candidates" underneath the icon floats to the left because of the parent float.. it ignores the text-align: center. In other browsers it works but not in FF any help? Also if anyone has a better way of writing this code I would be open to suggestions since I am slowly breaking away from table design. Thanks! Code: .main #header { background: #FFFFFF; padding: 0 10px 0 10px; border-bottom: 1px solid black; border-top: 1px solid black; } .icon_nav{ font-size: 12px; float: left; text-align: center; margin-right: 12px; border: 1px solid black; } Code: <div id="header"> <div style="float: left"> <img src="images/logo.png" align="left" style="margin-right: 4px"/> <div style="color: #992204; font-size: 18px">XYZ Company</div> <div style="color: #992204; font-size: 14px">Professional Company</div> <div style="color: #992204; font-size: 12px">481-555-5555</div> </div> <div style="float: right;"> <div class="icon_nav"><img src="images/icons/home.png" /><br />Home</div> <div class="icon_nav"><img src="images/icons/employers.png" /><br />Employers</div> <div class="icon_nav"><img src="images/icons/candidates.png" /><br />Candidates</div> <div class="icon_nav"><img src="images/icons/directions.png" /><br />Directions</div> <div class="icon_nav"><img src="images/icons/event_planning.png" /><br />Event Planning</div> <div class="icon_nav"><img src="images/icons/contactus.png" /><br />Contact Us</div> </div> <br style="clear: both;" /> <!-- end #header --> </div> 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 I have some text in a DIV that is updated dynamically with removeChild() and appendChild(). I've tried numerous combinations but I can't seem to get it to work correctly. CSS Code: Original - CSS Code div.chatlayer { position: absolute; top: -50px; left: 50px; border: 1px solid black; -moz-border-radius: 10px; padding: 5px; background-color: white; min-width: 100px; width: auto; text-align: center; visibility: hidden; } div.chatlayer { i've heard talk of text-align wrapper hacks, or just plain using tables... i got my main container div to align center by setting it to "margin:auto" but that code doesnt work for the divs inside that div.... can you please help me out... cuz i dont even know what the text-align hack is... i just have heard of it/ Hi. I've the following and I couldn't have the right div to vertically align when the left div have multiple lines. I tried vertical-align:middle on the right div and doesn't work. And this is driving me crazy. I hope anyone can help me. Thank you. <div style="width:800px"> <div style="width:730px;border:solid 1px red;float:left;"> LOTS OF CONTENT... MORE THAN 1 LINES </div> <div style="width:50px;float:right;border:solid 1px red;"> CLOSE LINK SHOULD BE HERE LATER </div> <div style="clear:both;"></div> </div> Ok, you can do this with a table by setting its height and width to 100% and then valigning to middle and centering. However is there a way to do it using CSS? I am trying to get a row of mixed divs to align horizontally center on the page. I would also like to move the Google Checkout logo up a bit so it is vertically centered relative to the logos on that row. Can you help me do these things? TIA! I've tried doing a lot of things including profanity but no go. The screenshot below is how the page looks now with this css: Code: .row div { height:75px; float:left; } #AuthorizeNetSeal,#googleCheckoutLogo,#paypal { margin-top:25px; } Code: <div class="row"> <!-- (c) 2005, 2011. Authorize.Net is a registered trademark of CyberSource Corporation --> <div class="AuthorizeNetSeal"> <script type="text/javascript" language="javascript">var ANS_customer_id="xxxxxxxx";</script> <script type="text/javascript" language="javascript" src="//verify.authorize.net/anetseal/seal.js" ></script> <a href="http://www.authorize.net/" id="AuthorizeNetText" target="_blank">Online Payment Service</a> </div> <img src="http://www.hotscripts.com/forums/images-manual/small_cc_icon_discover.gif" > <div><!-- Begin Official PayPal Seal --><a href="https://www.paypal.com/us/verified/pal=xxxxxxxxxxx" target="_blank"><img src="https://www.paypal.com/en_US/i/icon/verification_seal.gif" border="0"></A><!-- End Official PayPal Seal --></div> <div id="googleCheckoutLogo"></div><script src='https://checkout.google.com/buttons/logos?merchant_id=xxxxxxxxxxxx&loc=en_US&f=png' ></script> <span id="siteseal"><script type="text/javascript" src="https://seal.godaddy.com/getSeal?sealID=xxxxxxxx"></script></span> <img src="http://www.hotscripts.com/forums/images-manual/100satisguar80x79.gif"> </div> Here's what it looks like now: I was having some trouble centering my layout in Firefox. It looked fine in IE6 (yes... it's a pain to work in, but it's the nature of the beast when doing internal intranet stuff) when I simply used "text-align: center;" but the layout wouldn't center until I added "text-align: -moz-center;" under that (in the body style). Is this an acceptable way of doing things? Is this a flaw in Firefox or is it more likely that I'm not doing things right? (yes I know I haven't posted code, this was more a high level question of when/if "text-align: -moz-center;" should be used). I have used an image file "picture.PNG" like this : <h1><img src="picture.PNG" /></h1> then the css is h1{ text-align: center; margin: 20px; padding: 10px; height: 100px; } But it will not align the image in the center ? Am i going about this the wrong way ? or is it just a syntax error ? |