![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I'm just becoming comfortable with using CSS. At least, I thought I was. I put together a test page and it worked on IE 7. Then, I downloaded Firefox and Safari to check compatability on other browsers. I have a centered page with a top navigation bar, content area, and a footer (bottomNavBar). Inside the content area I have two sections, a left section and a right section. In the left there should be text, some sort of welcome text. In the right some sort of Flash intro video the user can play when they choose. The problem: I got the float to work in IE 7 (Sometimes it wouldn't. It seems tempermental.). However, the floats won't work on the other 2 browsers. In the other 2 it puts the first div listed above the second instead of side by side like in IE 7. Here is the code: ***First is the HTML*** body div class="header" img src="Logo001.png" / /div div class="container" div class="topNavBar" ul class="topNavBarUL" li class="topNavBarLI"><a class="topNavBarLinksCurrent" href="index.htm">Home</a></li li class="topNavBarLI"><a class="topNavBarLinks" href="page2.htm">Link2</a></li li class="topNavBarLI"><a class="topNavBarLinks" href="page3.htm">Link3</a></li li class="topNavBarLI"><a class="topNavBarLinks" href="page4.htm">Link4</a></li /ul /div div class="content" div class="contentIndexFlashIntro" script type="text/javascript" AC_FL_RunContent( 'codebase','http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab# version=9,0,28,0','width','350','height','350','ti tle','IntroVideo','src','Intro Video002','quality','high','pluginspage','http://www.adobe.com/shockwave/downloa d/download.cgi?P1_Prod_Version=ShockwaveFlash','movi e','IntroVideo002' ); //end AC code /script><noscript><object classid="clsid 27CDB6E-AE6D-11cf-96B8-444553540000"codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#ve rsion=9,0,28,0" width="350" height="350" title="IntroVideo" param name="movie" value="IntroVideo002.swf" / param name="quality" value="high" / embed src="IntroVideo002.swf" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Versio n=ShockwaveFlash" type="application/x-shockwave-flash" width="350" height="350"></embed /object></noscript /div div class="contentIndexWelcome" !--<center><h2>Welcome</h2></center hr/>-- p class="smallText">Paragraph 1</p p class="smallText">Paragraph 2</p hr/ ul><u class="smallText">Unordered List</u li><span class="smallText">Item 1</span></li li><span class="smallText">Item 2</span></li li><span class="smallText">Item 3</span></li li><span class="smallText">Item 4</span></li li><span class="smallText">Item 5</span></li li><span class="smallText">Item 6</span></li /ul hr/ p class="smallText">Concluding Paragraph</p><br / /div /div div class="bottomNavBar" p>© Copyright 2008</p /div /div /body ********************************* ***Next is the external CSS.*** body { font-family: Arial, Helvetica, sans-serif; background-color: #999999; margin: 0px; } .header { background-color: #FFFFFF; width: 100%; margin: 0px; padding: 0px 0px 0px 0px; top: 0px; } .container { background-color: #FFFFFF; width: 800px; margin-left: auto; margin-right: auto; margin-bottom: 0px; margin-top: 0px; } /* top navigation bar class ** I prefer to have a nav bar to the top rather than the left */ .topNavBar { width: 800px; height: 22px; background-color: #0080EE; border: 0px solid #FFFFFF; /* I turned off the pixel width because I didn't ** want a border right now. But I left the rest in case ** I wanted to change it back to 1px. */ } /* topNavBar link properties ** The idea is to have each link highlight when cursor comes over any part ** of the section, not just the words. Then goes back to normal when cursor ** leaves. The current page should have its own link highlighted always. */ ul.topNavBarUL { height: 17px; float: left; width: 100%; padding: 0; margin: 0; list-style-type: none; } li.topNavBarLI { display: inline; } a.topNavBarLinks:link, a.topNavBarLinks:active, a.topNavBarLinks:visited { float: left; text-decoration: none; color: #FFFFFF; background-color: #0080EE; padding: 0.15em 0.6em; border-right: 1px solid #FFFFFF; } a.topNavBarLinks:hover { color: #FFFFFF; background-color: #FF9900; text-decoration: none; } a.topNavBarLinksCurrent, a.topNavBarLinksCurrent:active, a.topNavBarLinksCurrent:visited, a.topNavBarLinksCurrent:hover { float: left; text-decoration: none; color: #FFFFFF; background-color: #00FF33; padding: 0.15em 0.6em; border-right: 1px solid #FFFFFF; } /* content class ** This is the part of the page that the content will go in. ** It should have the full width of the container class and ** stretch in height based on the content with a minimum ** height of 500px. */ .content { width: 800px; min-height: 400px; background-color: #FFFFFF; font-family: Arial, Helvetica, sans-serif; color: #000000; } /* content links ** The links in the content area will just be the regular links. ** Navigation links will all be given special classes to define them. */ a:link, a:active, a:visited { color: #0080EE; text-decoration: none; } a:hover { color: #FF9900; text-decoration: underline; } /* content headings, hr */ h1, h2, h3, h4, h5, h6 { font-family: Arial, Helvetica, sans-serif; color: #00FF33; margin-bottom: 2px; } hr { color: #0080EE; } p { text-indent: 20px; margin-top: 4px; } ul { margin-top: 4px; } li { list-style: square; color: #00FF33; } .contentIndexFlashIntro { padding-top: 2px; padding-right: 2px; float: right; } .contentIndexWelcome { float: left; text-align: justify; padding-top: 4px; padding-right: 10px; padding-bottom: 4px; padding-left: 4px; } |
#3
| |||
| |||
|
|
To make your contentIndexFlashIntro & contentIndexWelcome divs sit side-by-side you have to assign each a width. The combined total of those widths must be <=800px. -- Walt |
#4
| |||
| |||
|
|
To make your contentIndexFlashIntro & contentIndexWelcome divs sit side-by-side you have to assign each a width. The combined total of those widths must be <=800px. -- Walt Hi and thanks for the suggestion. I changed them both to total less than 800px and the contentIndexWelcome div went to the correct width but still won't start until the bottom of the contentFlashIntro div. Also, now it does the same thing in IE 7. |
#5
| |||
| |||
|
|
Can you upload the page all supporting files and post a link? If so, I'm sure we can solve this. |
|
as well as the widths mentioned by Walt - I added a clear to this otherwise unused class .bottomNavBar {clear:both;} and it looks the same now in IE6 & 7 , FF & Safari -- ~Malcolm~*... ~* |
#6
| |||
| |||
|
#7
| |||
| |||
|
|
To make your contentIndexFlashIntro & contentIndexWelcome divs sit side-by-side you have to assign each a width. The combined total of those widths must be <=800px. -- Walt |
![]() |
| Thread Tools | |
| Display Modes | |
| |