473,404 Members | 2,195 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,404 software developers and data experts.

Why html links to css work in dreamweaver but not on live browser?

My html file links to my external style sheet when im working in dreamweaver, but when I preview in browser, no styles. When I view in dreamweaver live mode i see the body background-color and the divs are in place. but no borders. When I preview in firefox, no styles at all. I will provide the code. Thanks, please help.

html code:

Expand|Select|Wrap|Line Numbers
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2.  
  3. <html xmlns="http://www.w3.org/1999/xhtml">
  4.  
  5. <head>
  6.  
  7. <link href="/css/main_layout.css" rel="stylesheet" type="text/css" />
  8.  
  9. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  10.  
  11. <title>Talk Tampa Sports</title>
  12.  
  13. </head>
  14.  
  15. <body>
  16.  
  17. <div id="wrapper">
  18.  
  19.     <div id="header">
  20.     </div>
  21.  
  22.     <div id="navbar">
  23.     </div>
  24.  
  25.     <div id="leftsidebar">
  26.     </div>
  27.  
  28.     <div id="rightsidebar">
  29.     </div>
  30.  
  31.     <div id="maincontent">
  32.     </div>
  33.  
  34.     <div id="footer">
  35.     </div>
  36.  
  37. </div>
  38.  
  39. </body>
  40.  
  41. </html>
  42.  
css code:

Expand|Select|Wrap|Line Numbers
  1. body {
  2.     background-color: #060;
  3. }
  4.  
  5. #wrapper {
  6.     width: 960px;
  7.     height: inherit;
  8.     margin: auto;
  9.     background-color: white;
  10.     border: solid, 1px, black;
  11.     }
  12.  
  13. #header {
  14.     width: 960px;
  15.     height: 100px;
  16.     border-bottom: solid, 1px, black;
  17. }
  18.  
  19. #navbar {
  20.     height: 10px;
  21.     width: 960px;
  22.     border-bottom: solid, 1px, black;
  23. }
  24.  
  25. #maincontent {
  26.     width: 608px;
  27.     height: 500px;
  28.     border-bottom: solid, 1px, black;
  29.     border-right: solid, 1px, black;
  30.     padding: 2px;
  31.     margin-left: 176px;
  32.     font: Verdana, Geneva, sans-serif, 1em, black;
  33. }
  34.  
  35. #leftsidebar {
  36.     width: 174px;
  37.     height: 500px;
  38.     float: left;
  39.     border-bottom: solid, 1px, black;
  40.     border-right: solid, 1px, black;
  41.     padding: 2px;
  42. }
  43.  
  44. #rightsidebar {
  45.     width: 174px;
  46.     height: 500px;
  47.     float: right;
  48.     border-bottom: solid, 1px, black;
  49.     padding: 2px;
  50. }
  51.  
  52. #footer {
  53.     width: 960px;
  54.     height: 100px;
  55. }
  56.  
Jan 18 '11 #1

✓ answered by JKing

Try this
Expand|Select|Wrap|Line Numbers
  1. <link href="../css/main_layout.css" rel="stylesheet" type="text/css" />
  2.  

7 7710
JKing
1,206 Expert 1GB
You need to get rid of the commas in some of your rules, specifically the border and font rules.

Should be like the following:
Expand|Select|Wrap|Line Numbers
  1. #header{
  2. border: 1px solid black;
  3. font: 1em black Verdana, Geneva, sans-serif;
  4. }
  5.  
Jan 18 '11 #2
thanks that helps a lot but I still get no style in my browser. everything looks perfect on dreamweaver, borders show in live mode now. I still get a blank white screen in my browser.
Jan 18 '11 #3
JKing
1,206 Expert 1GB
Try using an absolute path to your css file.

Where is your html file stored and where is your css file stored?
Jan 18 '11 #4
The html file is in a folder called html and the css file is in a folder called css. Both of those folders are contained in the same folder. I tried the absolute path and it is still not working.
Jan 18 '11 #5
JKing
1,206 Expert 1GB
Try this
Expand|Select|Wrap|Line Numbers
  1. <link href="../css/main_layout.css" rel="stylesheet" type="text/css" />
  2.  
Jan 18 '11 #6
thanks, that was the one. so what do those dots mean? andapparently they are required? Thanks for all your help.
Jan 18 '11 #7
JKing
1,206 Expert 1GB
The dots are there for going up a level in your directories. Because your html file is stored in its own folder you need to tell it to get out of that folder then into the css folder to the css file.
Jan 19 '11 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Ray Torres | last post by:
I would appreciate any help with the following problem. I have several different htm pages with (simalar) forms that are processed by the same PHP script. If there is data missing on the form,...
1
by: Richard | last post by:
I have a SVG document with links out to html pages which works when you run the SVG file i have tried to intergrate it into a coldfusion page and the links no longer work. The SVG file is : ...
13
by: NoSpamThankYouMam | last post by:
I am looking for a product that I am not sure exists. I have bookmarks to webpages in Internet Explorer, Mozilla Firefox, Opera, Netscape Navigator, and on a "Favorite Links" page on my website....
4
by: Paul | last post by:
Not sure if this is the right place for a CSS question but I saw some other CSS posts so here goes a pretty basic question. I want the color of an HTML link to be blue on one section of my HTML...
7
by: Aristotelis Pitaridis | last post by:
I am trying to extract all the links and the image URLs from an HTML file. I tried to read byte - byte the information in order to detect the URLs but it did not work because some JavaScript or...
8
by: leslietulip | last post by:
Greetings - this is the first time I am posting to this forum. I am using Javascript to ensure that the user enters all required fields in a form. However, this form is being spammed to death with...
13
by: Murray R. Van Luyn | last post by:
Hi, Does the JavaScript menu on this site work for your browser? Which browsers doesn't it work with, and how important are they? When I changed the site to use the new menu, traffic halved....
2
by: kristin09 | last post by:
Hi guys, I have a windows mobile application that has html pages generated on the fly (some pages have links in them). With the new browser MSIE 6.0 the links on the pages are not read as links....
1
by: mcelrob5 | last post by:
Ok I am writing a portlet using jsp with embedded java. The Java code accesses a file stored in a folder on a drive which contains HTML files located in the same folder however when i create links to...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.