PDA

View Full Version : CSS Developed in Notepad


shiftshape391953
10-23-2009, 02:13 PM
I'm taking a course in CSS. All coding is developed in Notepad. When I transfer it to Dreamweaver there's problems. The coding that belongs in a Dreamweaver webpage as opposed to a stylesheet only partially works when previewed in the browser. For example, the code developed in Notepad for a small box, centered left, with a blue border and a page background color of blue is perfect when viewed in the either IE or Mozilla. When this coding is incorporated into a Dreamweaver webpage, the background color for the page is absent. I cannot link an internal stylesheet to a Dreamweaver website, unless I use the entire access string starting with http:// and include all my subfolders -- the code for the link the professor has supplied doesn't work. Additionally, the coding in Notepad transferred to a Dreamweaver stylesheet again only partially works when it is linked up. Can somebody tell me what the problem is? The professor has no knowledge of Dreamweaver and none of the students know either.

SOJO web
10-23-2009, 04:06 PM
As far as linking goes, this really has nothing to with Dreamweaver... Dreamweaver is an authoring/editing tool - albeit with far more features than a text editor - but essentially, they are both tools.

For your CSS linking, you need to attach the style sheet to the document you want the styles to be used in. You can do this a couple of ways - one way would be to use the full URL path with the "http://" as you mentioned. The other way is to use a relative path. For example, if you page is "index.php" and happens to be in the site root and you were to keep your css page - I will choose the arbitrary name of "styles.css" - inside a folder called "css", you're "index.php" page would need this placed within the "head" code:

<link href="css/styles.css" rel="stylesheet" type="text/css" media="screen" />

Notice, the styles.css is linked using a relative file path. You could also use absolute linking like this:

<link href="/css/styles.css" rel="stylesheet" type="text/css" media="screen" />

Notice I added a slash in front of "css". This means no matter where in the site's hierarchy (even if I was 3 folders deep), it will attempt to locate the CSS folder starting from the root level and then go from there.

If you're not seeing your style in Dreamweaver, it's likely because of path issues that I just stated.

Best regards,

Brian