CSS - Css Popup In Center Of Window
Good day to you all,
I'm working on a css popup script. It work, but I would like the popup to be always in the center of the window. here is my code : PHP Code: echo "<a onmouseover=this.style.cursor=\"pointer\" ' onfocus='this.blur();' onclick=\"document.getElementById('".$value."').style.display = 'block' \" ><img src=\"".$directory."/".$value."\" width=\"50px\"></a>\n"; echo "<div id='".$value."' style='display: none; position: absolute; text-align:left; margin: -50px -200px; margin-top:-150px; z-index:50; border: solid black 1px; padding: 10px; background-color: rgb(255,255,225); text-align: justify; font-size: 12px; '>"; echo "<img src=\"".$directory."/".$value."\" /><br />".$value."<br/>"; echo "<div style='text-align: right;'><a onmouseover='this.style.cursor=\"pointer\" ' style='font-size: 12px;' onfocus='this.blur();' onclick=\"document.getElementById('".$value."').style.display = 'none' \" ><span style=\"color:#000000;\">Close</span></a></div></div>"; Thanks! Similar TutorialsI am using the following code how do I change it so that it would show up in the center of the brower window? Thanks Tim PHP Code: <div style="position: absolute; left: 0px; z-index: 1; top: 0px; align: center\"> <object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0 ,0\" width=\"544\" height=\"396\" id=\"cardio\" align=\"middle\"> <param name=\"allowScriptAccess\" value=\"sameDomain\" /> <param name=\"movie\" value=\"ads/cardio3.swf\" /> <param name=\"loop\" value=\"false\" /> <param name=\"quality\" value=\"high\" /> <param name=\"wmode\" value=\"transparent\" /> <param name=\"bgcolor\" value=\"#ffffff\" /> <embed src=\"ads/cardio3.swf\" loop=\"false\" quality=\"high\" wmode=\"transparent\" bgcolor=\"#ffffff\" width=\"544\" height=\"396\" name=\"cardio\" align=\"middle\" allowScriptAccess=\"sameDomain\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" /> </object> </div> Here's my entire code, sweet und simple: Code: body { background-image: url(''); background-attachment: fixed; background-repeat: repeat; background-position: center; position: absolute; background-color: #999999; overflow: scroll; border:0px; border-style: solid; font-family: garamond; color: #000000; scrollbar-face-color:#ffffff; scrollbar-arrow-color:#000000; scrollbar-track-color:#ffffff; scrollbar-shadow-color: #000000; scrollbar-highlight-color: #AE2473; scrollbar-3dlight-color: #000000; scrollbar-darkshadow-Color: #000000; } a:link { color: #000000; text-decoration: none; font-weight: bold; } a:visited { color: #232323; text-decoration: none; font-weight: bold; } a:hover { color: #ffffff; text-decoration: underline overline; font-weight: bold; } a:active { color: #000000; text-decoration: none; font-weight: bold; } .main { background-color: transparent; height: 900px; width: 900px; border-style: solid; position: fixed; overflow: scroll; font-family: garamond; color: #000000; } .header { background-color: #ffffff; height: 100px; width: 800px; border: 1px; border-style: solid; position: absolute; overflow: auto; left: 50px; font-family: garamond; color: #000000; } .sidebar { background-color: #ffffff; height: 600px; width: 200px; border: 1px; border-style: solid; position: absolute; top: 125px; left: 640px; font-family: garamond; color: #000000; } .index { background-color: #ffffff; height: 600px; width: 575px; border: 1px; border-style: solid; position: absolute; top: 125px; left: 50px; font-family: garamond; color: #000000; } .footer { background-color: #ffffff; height: 100px; width: 800px; border: 1px; border-style: solid; position: absolute; left: 5%; top: 750px; left: 50px; font-family: garamond; color: #000000; } h1 { background-color: #999999; color: #ffffff; width: 700px; height: 35px; border: 5px; border-color: #000000; border-style: double; cellpadding: 0; cellspacing: 0; } All I need help with, is aligning "MAIN" so that it scales to the browser, like this one here does: http://www.jonathanwold.com/tutorials/wordpress_theme/preview/ the page and all it's content scales over as you widen/shorten it. I tried using absolute and fixed. Fixed works for scaling, but it doesn't scroll, my tables go off the page without being able to scroll down and see it all. Absolute enables scrolling, but it sticks to the left hand side. No matter what :\ and none of the % commands work ( ie, left: 20%; ) Anyone can help? The spry tabs works fine if the page is directly accessed, however, when the page is accessed through the pop-up window (image below) the spry tabs are not click-able and all the contents are displayed all at once. URL I am using a local server so I do not have a url link. CSS Code Code: @charset "UTF-8"; /* SpryTabbedPanels.css - Revision: Spry Preview Release 1.4 */ /* Copyright (c) 2006. Adobe Systems Incorporated. All rights reserved. */ /* Horizontal Tabbed Panels * * The default style for a TabbedPanels widget places all tab buttons * (left aligned) above the content panel. */ /* This is the selector for the main TabbedPanels container. For our * default style, this container does not contribute anything visually, * but it is floated left to make sure that any floating or clearing done * with any of its child elements are contained completely within the * TabbedPanels container, to minimize any impact or undesireable * interaction with other floated elements on the page that may be used * for layout. * * If you want to constrain the width of the TabbedPanels widget, set a * width on the TabbedPanels container. By default, the TabbedPanels widget * expands horizontally to fill up available space. * * The name of the class ("TabbedPanels") used in this selector is not * necessary to make the widget function. You can use any class name you * want to style the TabbedPanels container. */ .TabbedPanels { margin: 0px; padding: 0px; float: left; clear: none; width: 100%; /* IE Hack to force proper layout when preceded by a paragraph. (hasLayout Bug)*/ } /* This is the selector for the TabGroup. The TabGroup container houses * all of the tab buttons for each tabbed panel in the widget. This container * does not contribute anything visually to the look of the widget for our * default style. * * The name of the class ("TabbedPanelsTabGroup") used in this selector is not * necessary to make the widget function. You can use any class name you * want to style the TabGroup container. */ .TabbedPanelsTabGroup { margin: 0px; padding: 0px; } /* This is the selector for the TabbedPanelsTab. This container houses * the title for the panel. This is also the tab "button" that the user clicks * on to activate the corresponding content panel so that it appears on top * of the other tabbed panels contained in the widget. * * For our default style, each tab is positioned relatively 1 pixel down from * where it wold normally render. This allows each tab to overlap the content * panel that renders below it. Each tab is rendered with a 1 pixel bottom * border that has a color that matches the top border of the current content * panel. This gives the appearance that the tab is being drawn behind the * content panel. * * The name of the class ("TabbedPanelsTab") used in this selector is not * necessary to make the widget function. You can use any class name you want * to style this tab container. */ .TabbedPanelsTab { position: relative; top: 1px; float: left; padding: 4px 10px; margin: 0px 1px 0px 0px; font: bold 0.7em sans-serif; background-color: #DDD; list-style: none; border-left: solid 1px #CCC; border-bottom: solid 1px #999; border-top: solid 1px #999; border-right: solid 1px #999; -moz-user-select: none; -khtml-user-select: none; cursor: pointer; } /* This selector is an example of how to change the appearnce of a tab button * container as the mouse enters it. The class "TabbedPanelsTabHover" is * programatically added and removed from the tab element as the mouse enters * and exits the container. */ .TabbedPanelsTabHover { background-color: #CCC; } /* This selector is an example of how to change the appearance of a tab button * container after the user has clicked on it to activate a content panel. * The class "TabbedPanelsTabSelected" is programatically added and removed * from the tab element as the user clicks on the tab button containers in * the widget. * * As mentioned above, for our default style, tab buttons are positioned * 1 pixel down from where it would normally render. When the tab button is * selected, we change its bottom border to match the background color of the * content panel so that it looks like the tab is part of the content panel. */ .TabbedPanelsTabSelected { background-color: #EEE; border-bottom: 1px solid #EEE; } /* This selector is an example of how to make a link inside of a tab button * look like normal text. Users may want to use links inside of a tab button * so that when it gets focus, the text *inside* the tab button gets a focus * ring around it, instead of the focus ring around the entire tab. */ .TabbedPanelsTab a { color: black; text-decoration: none; } /* This is the selector for the ContentGroup. The ContentGroup container houses * all of the content panels for each tabbed panel in the widget. For our * default style, this container provides the background color and borders that * surround the content. * * The name of the class ("TabbedPanelsContentGroup") used in this selector is * not necessary to make the widget function. You can use any class name you * want to style the ContentGroup container. */ .TabbedPanelsContentGroup { clear: both; border-left: solid 1px #CCC; border-bottom: solid 1px #CCC; border-top: solid 1px #999; border-right: solid 1px #999; background-color: #EEE; } /* This is the selector for the Content panel. The Content panel holds the * content for a single tabbed panel. For our default style, this container * provides some padding, so that the content is not pushed up against the * widget borders. * * The name of the class ("TabbedPanelsContent") used in this selector is * not necessary to make the widget function. You can use any class name you * want to style the Content container. */ .TabbedPanelsContent { padding: 4px; } /* This selector is an example of how to change the appearnce of the currently * active container panel. The class "TabbedPanelsContentVisible" is * programatically added and removed from the content element as the panel * is activated/deactivated. */ .TabbedPanelsContentVisible { } /* Vertical Tabbed Panels * * The following rules override some of the default rules above so that the * TabbedPanels widget renders with its tab buttons along the left side of * the currently active content panel. * * With the rules defined below, the only change that will have to be made * to switch a horizontal tabbed panels widget to a vertical tabbed panels * widget, is to use the "VTabbedPanels" class on the top-level widget * container element, instead of "TabbedPanels". */ /* This selector floats the TabGroup so that the tab buttons it contains * render to the left of the active content panel. A border is drawn around * the group container to make it look like a list container. */ .VTabbedPanels .TabbedPanelsTabGroup { float: left; width: 10em; height: 20em; background-color: #EEE; position: relative; border-top: solid 1px #999; border-right: solid 1px #999; border-left: solid 1px #CCC; border-bottom: solid 1px #CCC; } /* This selector disables the float property that is placed on each tab button * by the default TabbedPanelsTab selector rule above. It also draws a bottom * border for the tab. The tab button will get its left and right border from * the TabGroup, and its top border from the TabGroup or tab button above it. */ .VTabbedPanels .TabbedPanelsTab { float: none; margin: 0px; border-top: none; border-left: none; border-right: none; } /* This selector disables the float property that is placed on each tab button * by the default TabbedPanelsTab selector rule above. It also draws a bottom * border for the tab. The tab button will get its left and right border from * the TabGroup, and its top border from the TabGroup or tab button above it. */ .VTabbedPanels .TabbedPanelsTabSelected { background-color: #EEE; border-bottom: solid 1px #999; } /* This selector floats the content panels for the widget so that they * render to the right of the tabbed buttons. */ .VTabbedPanels .TabbedPanelsContentGroup { clear: none; float: left; padding: 0px; width: 30em; height: 20em; } See here the live version: jsfiddle.net/nrWug i want that the menu in the popup is binded ondrag or onresize to the outer popup. How can i bind these two to make the dialog draggable and resizable? thanks for your time. Hi everyone, I am wondering why IE sucks so bad... Just kidding. Actually, my CSS popup appears in Mozilla Firefox (best browser on earth ) but not in IE. The guy that I learned it from (http://www.meyerweb.com/eric/css/edge/popups/demo.html) works in both IE and Mozilla, and I dont understand why mine doesn't any help would be appreciated Mine: Code: div#links a span {display: none;} div#links a:hover span {display: block; position: absolute; top: 160px; left: -10px; width: 125px; padding: 0px; margin: 0px; z-index: 100; color: #000; background: #fff; font: 10px Verdana, sans-serif; text-align: left; } div#links {position: absolute; top: 96px; left: 27px; width: 58px; height: 20px; font: 10px Verdana, sans-serif; z-index: 100;} div#links a {display: block; font: 10px Verdana, sans-serif; padding: 0px; margin: 0 0 1px; border-width: 0; text-decoration: none; color: #fff; } His: Code: div#links {position: absolute; top: 81px; left: 0; width: 166px; height: 700px; font: 16px Verdana, sans-serif; z-index: 100;} div#links a {display: block; text-align: center; font: bold 1em sans-serif; padding: 5px 10px; margin: 0 0 1px; border-width: 0; text-decoration: none; color: #FFC; background: #444; border-right: 5px solid #505050;} div#links a:hover {color: #411; background: #AAA; border-right: 5px double white;} div#links a span {display: none;} div#links a:hover span {display: block; position: absolute; top: 180px; left: 0; width: 125px; padding: 5px; margin: 10px; z-index: 100; color: #AAA; background: black; font: 10px Verdana, sans-serif; text-align: center;} I'm using Eric Meyer's Pure CSS Popups template for a new site. I want to have a graphic pop up in the middle of the page for one particular link when clicked, rather than have the browser load a new page, but I don't know how to go about it. Can anybody shed some light on how to alter the stylesheet to have this one link act differently from the rest? Thanks. Hi to all How to show popup on hover the link through css like <a here="">Hover here</a> show a popup on left side of the link thanks in advance Hi guys, i really don't know if this can be accomplished with CSS but here it goes: I want a user that's filling a form on my web application to be able to click on a certain field(or a link near that field) and pop out another form, fill it, submit it and then continue to fill the original form. Maybe there's a bit of Javascript there or a combination of technologies, i really don't know so forgive me if i'm in the wrong forum, but i've seen similar stuff done with CSS, so if any of you has any idea on how i can accomplish this i'd appreciate it very much. I've attached a graphic to illustrate it better. Thanks! Hi I'm building a selectbox insead of using the common select tag. I use the windows.createpopup() method to display the list of choise. Differently to the div object the popup object is like a new window so it doesn't inherit the css style sheet I've attached to the main window. I tought to attach it by using the addImport(url) method of the styleSheet object but it doesn't seem to work. Here it's my code, the show function it's called when the selectbox expands: var Select_box = window.createPopup(); Select_box.document.styleSheets[0].addImport("URL('common/css/default_style.css');") function show(element) { if (Select_box.isOpen==false) { Select_box.document.body.innerHTML = Select_box_content.innerHTML; Select_box.document.body.className='selectbox'; Select_box.show(0, 18, 150, 50, element); } else { Select_box.hide(); } } I've noticed that using the addImport method on the main window, and not on the instance of the select_box, with 0 index of the styleSheet the error doesn't occur but it doesn't also change the proprety. Tring using any other index value it gives me the usual error. So how can I attach a style sheet to a popup created with the window.createpopup()? Thank you I have the following page: http://take2records.com/test/dbtest.php Which you can test using http://take2records.com/test/dbtest...4&id_num=404100 What I need is to be able to have a popup any time you hover over a particular row in the generated table. I found this code to do the hover: Code: class="thumbnail" href="#thumb"><img src="media/tree_thumb.jpg" width="100px" height="66px" border="0" /><span><img src="media/tree.jpg" /><br />Simply beautiful.</span></a> <br /> <br /> <a class="thumbnail" href="#thumb">Dynamic Drive<span><img src="media/dynamicdrive.gif" /><br />Dynamic Drive</span></a><br /> But I don't see how to apply this when the user hovers over a particular row. I'll admit right off - I don't know much about CSS. I have a page that displays the event logs on my servers. If I display the whole message of each event it will take up way too much space. I'd like to have it so that if you move your mouse over the message like of the event, a "window" pops up (without navigating away from the page they are on) with the whole message. I know my viewers are going to be using IE 6.1. I've looked through here and on google for it, and I think I'm just looking in the wrong place. Thanks. http://siliconsatan.com/test.php The above test example is for a DIV that will show / hide with a click on a button / link. Problem: Scroll down a bit, click on one of the links. The whole page will scroll to the top. It has something to do with the <a> tag. I could get rid of the <a> tag, but then I would have to use JS to both do the roll-over, and trap the "click" event? I'm actually using JS to trap the "click" event anyway, but I was hoping for a fully CSS roll-over function. (The content - <li> ... </li> - is dynamically populated, or in the final it will be) What am I doing wrong? I have a div that I am using as a pop up layer. I just set the visible attribute on mouseover and mouseout. I want to have that dic pop up in the center of the screen vertically and horizontally. I have not had much luck with other examples but this is what I have: Div Code: <div class="popbox" id="1" onMouseover="showpop('1');" onMouseout="hidepop('1');"> <p class="popboxheader">HEADER</p> <p class="popboxcontent"> <table> <tr> <td class="popboxcontentleft" valign="top"><p>some content here</p></td> <td class="popboxcontentright" valign="top"><p>more content</p></td> </tr> </table> </p> </div> CSS Code: div.popbox { text-align: left; background-color:#ffffff; border: 1px solid black; padding: 5px; width: 570px; visibility: hidden; margin:0 auto; } .popboxheader { padding: 5px; color: white; letter-spacing: 2pt; background-color: #003399; font-family: Verdana, san-serif; font-size:16px; color:#ffffff; color:#ffffff; font-weight:bold; text-align:left; } .popboxcontent { font-size: 10pt; font-weight: normal; text-align: left; font-family: Verdana, san-serif; color:#4074b7; color:#0349A3; } .popboxright { font-size: 9pt; font-weight: normal; text-align: left; width:200px; font-family: Verdana, san-serif; color:#4074b7; color:#0349A3; } Script Code: function showpopp(cid){ var obj = document.getElementById(cid); obj.style.visibility = "visible"; } function hidepop(cid){ var obj = document.getElementById(cid); obj.style.visibility = "hidden"; } I am not sure, but I am writingthe div at the end of the content that is always shown on the screen, just for some info. Any help is appreciated. I am having a small problem with centering a main container div.. The main div is 700 pixels wide .. I have numerous divs inside this container div. Everything is peachy, but I cant seem for the life of me to get the container div centered in the browser window... I tried <div align="center"> even tried text-align:center; any thoughts? I'm strugling with this code. The homepage is http://thebeadingsite.com and I can't get this to line up properly. Here's my code, any suggestions?? Code: <!DOCTYPE html> <html> <head> <meta http-equiv="content-type" content="text/html; charset=UTF-8"> <title>The Beading Site</title> <style type='text/css'> body { background-color: black; } #bg-right { background-color: white; position: absolute; top: 0; bottom: 0; left: 50%; right: 0; z-index: -1; } #content { position: relative; top: 0; bottom: 0; left: 25%; right: 0; z-index: 0; } </style> </head> <body> <div id="bg-right"></div> <div id="content"><table id="Table_01" width="800" height="601" border="0" cellpadding="0" cellspacing="0"> <tr> <td colspan="5"> <img src="images/bnt-site-final_01.jpg" width="800" height="158" alt=""></td> </tr> <tr> <td colspan="2" rowspan="2"> <img src="images/bnt-site-final_02.jpg" width="623" height="421" alt=""></td> <td><a href="http://www.etsy.com/shop/mixaleena" target="_blank"> <img src="images/bnt-site-final_03.jpg" width="72" height="38" border="0" alt="Click here to order online at Etsy!"></a></td> <td colspan="2" rowspan="2"> <img src="images/bnt-site-final_04.jpg" width="105" height="421" alt=""></td> </tr> <tr> <td> <img src="images/bnt-site-final_05.jpg" width="72" height="383" alt=""></td> </tr> <tr> <td> <img src="images/bnt-site-final_06.jpg" width="526" height="21" alt=""></td> <td colspan="3"> <a href="mailto:mixaleena@thebeadingsite.com?subject=Comments from the front page"> <img src="images/bnt-site-final_07.jpg" width="247" height="21" alt="" border="0"></a></td> <td> <img src="images/bnt-site-final_08.jpg" width="27" height="21" alt=""></td> </tr> <tr> <td> <img src="images/spacer.gif" width="526" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="97" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="72" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="78" height="1" alt=""></td> <td> <img src="images/spacer.gif" width="27" height="1" alt=""></td> </tr> </table> </div> </body> </html> Thanks for taking the time to read my question. I have a 19 in CRT and a 22 in wide screen LCD monitor. I am trying to make my content center on the page, regardless of the monitor. As it stands, it looks to be centered on teh 19 in, but on the 22 in, it is very much to the left side of the screen. I just got the 22 in. Is there something different you have to do for wide screen monitors? I'm using margin: auto 0px; I have margin and padding off for my Body {} and have set marging and padding on all appropreate elements so that they work the same in IE and FF. In my html page, I'm using xhtml strict. Thanks, Brad Hi all, I've got a table here and can't seem to get text-align:center in the cells that have colspan='2' (f1s, f2s...) as an attribute. HTML Code: Original - HTML Code <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Game</title> <style type='text/css'> table { border: 1px solid black; } tr.top { font-size:10px; } tr.tall { height:50px; } td { width:20px; border: 1px solid black; text-align:center; } td.name { font-size:18px; width:100px; height:50px; } td.finalscore { color:red; font-size:18px; width:40px; } </style> </head> <body> <table cellpadding=0 cellspacing=0> <tr class='top'> <td rowspan='2' colspan='2' class='name'>Name </td> <td> f1a </td> <td> f1b </td> <td> f2a </td> <td> f2b </td> <td> f3a </td> <td> f3b </td> <td> f4a </td> <td> f4b </td> <td> f5a </td> <td> f5b </td> <td> f6a </td> <td> f6b </td> <td> f7a </td> <td> f7b </td> <td> f8a </td> <td> f8b </td> <td> f9a </td> <td> f9b </td> <td> f10a </td> <td> f10b </td> <td> f10c </td> <td style="background-color:black"> </td> </tr> <tr class='tall'> <td colspan='2'>f1s</td> <td colspan='2'>f2s</td> <td colspan='2'>f3s</td> <td colspan='2'>f4s</td> <td colspan='2'>f5s</td> <td colspan='2'>f6s</td> <td colspan='2'>f7s</td> <td colspan='2'>f8s</td> <td colspan='2'>f9s</td> <td colspan='2'>f10s</td> <td colspan='2'>Score</td> </tr> </table> </body> </html> <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <title>Game</title> <style type='text/css'> table { border: 1px solid black; } tr.top { font-size:10px; } tr.tall { height:50px; } td { width:20px; border: 1px solid black; text-align:center; } td.name { font-size:18px; width:100px; height:50px; } td.finalscore { color:red; font-size:18px; width:40px; } </style> </head> <body> <table cellpadding=0 cellspacing=0> <tr class='top'> <td rowspan='2' colspan='2' class='name'>Name </td> <td> f1a </td> <td> f1b </td> <td> f2a </td> <td> f2b </td> <td> f3a </td> <td> f3b </td> <td> f4a </td> <td> f4b </td> <td> f5a </td> <td> f5b </td> <td> f6a </td> <td> f6b </td> <td> f7a </td> <td> f7b </td> <td> f8a </td> <td> f8b </td> <td> f9a </td> <td> f9b </td> <td> f10a </td> <td> f10b </td> <td> f10c </td> <td style="background-color:black"> </td> </tr> <tr class='tall'> <td colspan='2'>f1s</td> <td colspan='2'>f2s</td> <td colspan='2'>f3s</td> <td colspan='2'>f4s</td> <td colspan='2'>f5s</td> <td colspan='2'>f6s</td> <td colspan='2'>f7s</td> <td colspan='2'>f8s</td> <td colspan='2'>f9s</td> <td colspan='2'>f10s</td> <td colspan='2'>Score</td> </tr> </table> </body> </html> Any pointers? I'm not quite sure how to do this: Code: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Untitled Document</title> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> <style type="text/css"> #content { float: left; width: 437px; margin: 10px; margin-top: 0; } /* end #content */ #content ul { list-style-type: none; margin-top: auto; padding-bottom: 1em; background-color: #00ff00; } /* end #content ul */ #content ul li { float: left; } /* end #content ul li */ #content ul li a { position: relative; left: 1px; top: 1px; text-decoration: none; color: #ff0000; } /* end #content ul li a */ #content p { clear: both; } .shadow { color: blue; position: absolute; left: -1px; top: -1px; } /* end .shadow */ </style> </head> <body> <div id="content"> <ul> <li><a href="#">Link 1<span class="shadow">Link 1</span></a></li> <li><a href="#">Link 2<span class="shadow">Link 2</span></a></li> <li><a href="#">Link 3<span class="shadow">Link 3</span></a></li> <li><a href="#">Link 4<span class="shadow">Link 4</span></a></li> </ul> </div> </body> </html> I need the text to be centered in the green box. Not sure the best way to do that. Thanks for reading my question Why does this not center the contents of my page in Firefox but it does in IE? This code is in my linked CSS file. Code: body { text-align: center; margin-top: 10px; background-image: url(images/fall-leaves.jpeg); background-attachment: fixed; /*background-color: #d8d8d8;*/ } Thanks for taking the time to read my question. I have a div that has a specified width, and if I put margin-left: auto; and margin-right: auto; the div centers with in the parent div. I have another div that I don't want to have a specified width, and as a result the auto's don't center the div. How can I center my div? I've tried display: block; and that just makes it as wide as the parent div. If I remove display and put float: left, it sizes properly (shrinks to fit the contents), but floats left and doesn't heed the margin auto's. The colors are there to see the containers... I don't plan on keeping them.. please see http://www.scopicdesigns.com/LisaCl..._Portfolio1.htm for example. Thanks, Brad |