Jump to content

Trouble with CSS.


Jared

Recommended Posts

I can't seem to figure out how to get CSS to work for my webpage. I did everything I saw in Stefan's video tutorial, and double checked my code, but my CSS file doesn't even have a proper icon like his for some reason, and my html code doesn't seem to recognize it. I've tried using notepad and wordpad to write the CSS code, and neither work. I'm trying to make links out of images, and although I got that part to work, I can't use CSS to position them properly on the page. Right now they are just going down the left hand side of the page. Also, I have a white border around all my images that spans the length of the page and I can't get rid of it. Can anyone help me with these issues? Any help would be much appreciated. Thanks.

Link to comment
Share on other sites

Posting your code linking it would help.

 

But most often is:

 

A) The Path to the file, if it is external, is wrong.

 

B) When you saved it your program tacked on another ending. Notepad will save it as a text file, so myfile.css.txt. Click on it and rename it by deleting the .txt after saving it.

Link to comment
Share on other sites

I named my CSS file HomePage.css, and it turned into a default icon with Cascading Style Sheet written out underneath my title with the .css file extension missing, but why would the icon not be the standard wordpad page icon?

 

Because by changing the extension to .css, you changed the type of file it is. Fundamentally it no longer is a wordpad page.

Link to comment
Share on other sites

...and...

 

Is your style sheet in the same folder as your html? If not then your link path is wrong.

 

 

Its also a good habit to only use lower case letters. (homepage.css instead of HomePage.css) But as long as that's consistent it shouldn't be causing your problem.

Link to comment
Share on other sites

A common problem is that people save a file as say home.html or style.css and it doesn't work because it's actually been saved as home.html.txt or style.css.txt. Check in Windows Explorer with view Details to see if files have a .txt extension and remove it.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...