Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

CSS Stylesheet not pulling into html

Featured Replies

Hi!!

 

This is my first post here.

 

I'm coding a site in html/ css and found that my css stylesheet does not apply to my html.

 

Does anyone know what could be wrong here?

 

I checked my html and it is all valid without errors or missing (closing) tags. Attached is a snip of my html.

 

Thanks for your help. html pic.tiff

Try using relative paths rather than absolute paths.

 

This will also help when you want to move the website around.

try this

 

<link href="style.css" rel="stylesheet" type="text/css" />

  • Author

Thanks guys....I tried both the above options but still nothing happens...any suggestions? Thanks

Where in relation to your html file is your css file

are the both in the same folder, are they in there own folders

  • Author

Again, attached is a snip of my html. I added some basic styling in the stylesheet but nothing happens.....not sure what I am doing wrong here......

test.tiff

  • Author

Thanks...well, index.html and style.css are both in the same folder and I'm using relative paths..

  • Author

and the link tag is placed inside the header tag..

  • Author

No sorry, no link yet, I'm doing this on my my computer. It should work I assumed.....but it doesn't :flm15:

  • Author

You mean: <?xml version="1.0" encoding="utf-8"?>

 

that was included automatically by BBedit... should I remove that?

(I'm sorry if you consider that a stupid question but I'm learning..;-))

yeah, worth a try, can't see what it's used for and maybe screwing things up

if the files are indeed in the same files, then it's a spelling issue, double check the spelling and file ending of the css file.

  • Author

Thanks...tried all of that and it still does not work...what to do now?!

  • Author

Thanks for your help so far....

 

I uploaded my raw html file to my site: www.leonfassbender.com

 

You may check the html with firebug.... I just can't get it styled, not even with the easiest of CSS rules...

 

(this is my first attempt ever writing html from scratch but I haven't found any errors. All the links and images are broken but that shouldn't matter for some simple CCS styling).

  • Author

I have now and it seems to work...... then why would it not work when previewing in in a browser?? This is very strange..

Are you using the same browser to view on line as locally, you haven't got styles disabled in one of your browsers, did you have both files in the same folder di you refresh your browser after making the changes

 

:unknw:

 

I don't know mate but glad you got it working

  • Author

Thanks man! Really appreciate your time and help! Can go to bed peacefully now! Thanks again cheers! :drinks:

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.