External CSS stylesheets
External CSS stylesheets
Should CSE (v8 Standard) automatically validate external stylesheets?
I have a page with the usual link tag, e.g.
<link href="css/main.css" rel="stylesheet" media="all" type="text/css" />
I know there are errors in it but CSE reports nothing. I do get warnings in the Styles tab for some inline styles that library code generates.
If I select the stylesheet in the Links tab and use 'Open Link in Editor' I can then F6 and find the errors.
I had hoped CSE would do this automatically. I think I have all the correct settings (e.g. 'Enable CSS style checking' in the 'Style (CSS)' options tab).
Thanks in advance,
Chris
I have a page with the usual link tag, e.g.
<link href="css/main.css" rel="stylesheet" media="all" type="text/css" />
I know there are errors in it but CSE reports nothing. I do get warnings in the Styles tab for some inline styles that library code generates.
If I select the stylesheet in the Links tab and use 'Open Link in Editor' I can then F6 and find the errors.
I had hoped CSE would do this automatically. I think I have all the correct settings (e.g. 'Enable CSS style checking' in the 'Style (CSS)' options tab).
Thanks in advance,
Chris
- Albert Wiersch
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
- Contact:
Hi Chris,
You will have to open external CSS files separately to check them for errors. However, if you're crawling a site using the Batch Wizard, then it will in most cases also check the CSS file.
When working with a document in the editor, CSE HTML Validator does not automatically go into other documents. This keeps things simpler and lets you work only on the document you have opened.
You will have to open external CSS files separately to check them for errors. However, if you're crawling a site using the Batch Wizard, then it will in most cases also check the CSS file.
When working with a document in the editor, CSE HTML Validator does not automatically go into other documents. This keeps things simpler and lets you work only on the document you have opened.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
-
- Rank IV - Intermediate
- Posts: 170
- Joined: Tue Aug 09, 2005 1:20 pm
- Location: Spokane WA
- Contact:
Re:
So are you saying there could be style errors in your HTML document, i.e., you've used a CSS style that's not in the external CSS stylesheet file and HTML Validator won't flag that error?Albert Wiersch wrote:Hi Chris,
You will have to open external CSS files separately to check them for errors. However, if you're crawling a site using the Batch Wizard, then it will in most cases also check the CSS file.
When working with a document in the editor, CSE HTML Validator does not automatically go into other documents. This keeps things simpler and lets you work only on the document you have opened.
paulp575
- Albert Wiersch
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
- Contact:
Re: Re:
Hi Paul,paulp575 wrote:So are you saying there could be style errors in your HTML document, i.e., you've used a CSS style that's not in the external CSS stylesheet file and HTML Validator won't flag that error?
CSE HTML Validator finds a lot of issues but if you are asking if it will find a problem when you use a CSS class that doesn't exist then the answer is no. That is one type of issue that CSE HTML Validator cannot currently detect. However, you can write a custom user function to only allow the valid CSS classes and to generate an error if a class is used and not recognized. This might get rather involved.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
-
- Rank IV - Intermediate
- Posts: 170
- Joined: Tue Aug 09, 2005 1:20 pm
- Location: Spokane WA
- Contact:
Re: External CSS stylesheets
Sorry, I'm still confused.
I have the validator engine options set to check CSS. However, when I check a file, the styles tab is blank; nothing there.
So what CSS does the validator check?
I was hoping it could validate a file and determine there is an external style sheet and check the styles you used against the styles listed in the external stylesheet, but I guess that gets too complicated?
I have the validator engine options set to check CSS. However, when I check a file, the styles tab is blank; nothing there.
So what CSS does the validator check?
I was hoping it could validate a file and determine there is an external style sheet and check the styles you used against the styles listed in the external stylesheet, but I guess that gets too complicated?
paulp575
- Albert Wiersch
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
- Contact:
Re: External CSS stylesheets
Hello,paulp575 wrote:I have the validator engine options set to check CSS. However, when I check a file, the styles tab is blank; nothing there.
If the Styles tab is empty then no CSS problems were detected. This could also mean CSS checking is turned off.
It checks CSS syntax, which means it mostly checks the CSS properties and their values, among some other syntax tests. It can also pick up links in CSS for link checking.paulp575 wrote:So what CSS does the validator check?
Yes, that gets complicated. It doesn't check to make sure the classes you use are defined somewhere. Also, sometimes classes that don't exist (aren't defined) in the CSS styles may be purposely used for other reasons, like for use with JavaScript. This creates another complication.paulp575 wrote:I was hoping it could validate a file and determine there is an external style sheet and check the styles you used against the styles listed in the external stylesheet, but I guess that gets too complicated?
I hope this helps to clarify what CSE HTML Validator checks and what it doesn't. Please let me know if you have any more questions.
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
-
- Rank IV - Intermediate
- Posts: 170
- Joined: Tue Aug 09, 2005 1:20 pm
- Location: Spokane WA
- Contact:
Re: External CSS stylesheets
No more questions - thanks for the interaction.
I wonder if somewhere (maybe in the Styles tab or in the Main tab?) there should be something to explain when you have it checking and nothing appears in the styles tab? Just a thought.
Thanks,
I wonder if somewhere (maybe in the Styles tab or in the Main tab?) there should be something to explain when you have it checking and nothing appears in the styles tab? Just a thought.
Thanks,
paulp575
- Albert Wiersch
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
- Contact:
Re: External CSS stylesheets
Thanks for the suggestion. In a future update I'll see if I can add a message in the "Styles" tab to indicate that there are no style messages so it's not completely blank when there are no style messages. This should be clearer and less confusing.paulp575 wrote:No more questions - thanks for the interaction.
I wonder if somewhere (maybe in the Styles tab or in the Main tab?) there should be something to explain when you have it checking and nothing appears in the styles tab? Just a thought.
Thanks,
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
- Albert Wiersch
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
- Contact:
Re: External CSS stylesheets
How about this?
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
-
- Rank IV - Intermediate
- Posts: 170
- Joined: Tue Aug 09, 2005 1:20 pm
- Location: Spokane WA
- Contact:
Re: External CSS stylesheets
To be consistent, how about a zero following the word "Styles" in the Styles tab?
paulp575
- Albert Wiersch
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
- Contact:
Re: External CSS stylesheets
I thought of that... but then to be consistent most of the other tabs would need it too, and that would make the length of all the tabs even longer than it is now. I'm not sure it would be an overall benefit.paulp575 wrote:To be consistent, how about a zero following the word "Styles" in the Styles tab?
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial
Re: External CSS stylesheets
I’ve just accidentally solved a CSS problem that had been bugging me both yesterday and this morning – but I don’t know how! Can anyone explain the following? I prepared an HTML web page with all the formatting contained in the <style> section of the <head>. When I had got it just the way I wanted I cut it out of the HTML and pasted it in to an external CSS style sheet, correctly linking to it with the appropriate <link href=> command, a job I’ve done hundreds of times before. Strangely, the web page didn’t render properly, mainly in the <header> area. I tried pasting and re-pasting bits of the code from the CSS into the <head>and back again, several times, always finding a mismatch between how it rendered with the CSS link and with it overridden by the same code in the <head>. After lunch I went back to it and eventually, mysteriously, got them to agree. Anyone any idea what sort of thing could have caused this?
- Albert Wiersch
- Site Admin
- Posts: 3785
- Joined: Sat Dec 11, 2004 9:23 am
- Location: Near Dallas, TX
- Contact:
Re: External CSS stylesheets
If it mysteriously started working, then my thought would be that it was some kind of cache issue. Did you do a Ctrl+F5 (and not just F5) to force a refresh of everything (assuming you are using Chrome or other browser where that works)?Davpar wrote: ↑Tue Jul 17, 2018 10:21 am I’ve just accidentally solved a CSS problem that had been bugging me both yesterday and this morning – but I don’t know how! Can anyone explain the following? I prepared an HTML web page with all the formatting contained in the <style> section of the <head>. When I had got it just the way I wanted I cut it out of the HTML and pasted it in to an external CSS style sheet, correctly linking to it with the appropriate <link href=> command, a job I’ve done hundreds of times before. Strangely, the web page didn’t render properly, mainly in the <header> area. I tried pasting and re-pasting bits of the code from the CSS into the <head>and back again, several times, always finding a mismatch between how it rendered with the CSS link and with it overridden by the same code in the <head>. After lunch I went back to it and eventually, mysteriously, got them to agree. Anyone any idea what sort of thing could have caused this?
More info on "force refreshes" and bypassing your cache:
https://en.wikipedia.org/wiki/Wikipedia ... your_cache
Albert Wiersch, CSS HTML Validator Developer • Download CSS HTML Validator FREE Trial