Questions tagged [css]
CSS, short for Cascading Style Sheets, is a language used to control the presentation (including colors, layout, and fonts) of HTML and XHTML documents.
703
questions
80
votes
8
answers
34k
views
How bad is it to use display: none in CSS?
I've heard many times that it's bad to use display: none for SEO reasons, as it could be an attempt to push in irrelevant popular keywords. A few questions:
Is that still received wisdom?
Does it ...
45
votes
5
answers
12k
views
Why do big sites host their images/css on external domains?
Why do sites like Facebook, Twitter, and Google host their images and css on external domains such as:
Facebook: static.ak.fbcdn.net
Twitter: a0.twimg.com
Google: ssl.gstatic.com
Question(s):
Is is ...
44
votes
7
answers
10k
views
Why should we use tags like p, span, hx tags when we can use CSS instead?
Why should we use tags like p, span, hx tags when we can use CSS instead? Is it important from an SEO point of view?
40
votes
4
answers
107k
views
How do I set expiration headers for CSS, JS, and Images?
I have recently analysed my website with pagespeed addon on firebug. It suggested me to set expiration on CSS, JS and image files.
I am wondering how do i do this?
30
votes
5
answers
9k
views
Why insert static files (CSS, images, JavaScript, ECC) in a subdomain?
Why so many big and little sites inserts static files (CSS, images, JavaScript, ECC) in a subdomain like media.example.com or s2.static.example.com?
What are the advantages? Why not just a directory ...
26
votes
11
answers
18k
views
Are HTML tables bad for SEO?
A lot of designers discourage the use of tables but I have a layout where I'll use more div structure to achieve something made simple with a table..
Are tables bad for search engines?
edit: I will ...
25
votes
2
answers
31k
views
How to mimic <pre> with <div>
I am publishing python code on a website (that is CMS). I have a python script which reads any python script and makes a syntax-colored HTML out of it. Then I copy/paste this HTML into the CMS editing ...
23
votes
10
answers
2k
views
What is new in HTML5/CSS3?
I've seen this site and this site, but that's a lot to digest. What are the main things about HTML5 that make it different/better than regular old (X)HTML/CSS?
22
votes
4
answers
15k
views
Is there a way to compile LESS files to CSS (so that every browser doesn't have to)?
I'm considering using LESS but I cringe at the thought of a browser having JavaScript disabled and my CSS not being readable (and the site looking awful).
Also, it offends the engineer in me to force ...
22
votes
6
answers
23k
views
Is there a tool that converts css to less.css?
I have a pretty big CSS file, that I want to convert to less. When I wrote the CSS I did not know less.css, but now I still want to use my old CSS.
Is there a tool that can help me to convert it ...
22
votes
8
answers
17k
views
Should I split a large CSS media queries file into separate files for each screen size?
I am working on a responsive design website to deliver content for all screen sizes. I have media queries for 5 different "steps", and the CSS file is around 30 Kb.
Would it be better to split this ...
21
votes
6
answers
13k
views
Do CSS class names have any effect on SEO?
I have seen some of our competitors using keyword-rich CSS class names. As an example, if I were in the pet grooming business, I would name my #menu as:
#menu.pet.grooming.moreKeywords.etc { ... }
...
21
votes
4
answers
5k
views
Are CSS sprites bad for SEO?
Nowadays often what was accomplished with an <img> tag is now done with something like a <div> with a CSS background image set using a CSS 'sprite' and an offset.
I was wondering what ...
20
votes
5
answers
3k
views
Remembering CSS left, top, right, bottom
When using CSS what little tricks have you done to remember (perhaps a saying?) the order of left, top, right, bottom when defining combined CSS attributes such as border, margin and padding.
I'm ...
20
votes
5
answers
599
views
What documentation exists for HTML, CSS, and JavaScript?
PHP users have the PHP.net docs
Ruby users have Ruby-Doc.org
Python users have docs.python.org
jQuery users have docs.jquery.com
All are considered go-to references when working within those ...
19
votes
4
answers
23k
views
Is the Bootstrap CSS on a CDN yet?
Just checking to see if anyone knows of a CDN for the bootstrap css framework.
18
votes
6
answers
12k
views
How can I find unused/unapplied CSS rules in a stylesheet?
I've got a huge CSS file and an HTML file. I'd like to find out which rules are not used while displaying a HTML file. Are there tools for this?
The CSS file has evolved over few years and from what ...
18
votes
1
answer
7k
views
How Google reacts on display:none for CSS media query?
According to Google Webmaster guideline "Hidden text" is not acceptable. Which means I do have a dov containing some good amount of title or paragraph with link or images if I make it display:none in ...
17
votes
1
answer
7k
views
Improve web site performance via parallel CSS downloads?
I was optimizing the page load time of a website. One of the ways was by combining multiple HTTP requests for CSS into one combined HTTP request. But one of the reviewers asked an interesting question:...
16
votes
9
answers
4k
views
Should I use HTML5 and/or CSS3 to build my website?
The new HTML5/CSS3 (Web8!) stuff sounds cool! Should I start using it now or stick with css/xhtml wait until more browsers can use it?
16
votes
4
answers
29k
views
How to pre-load images used only on hover?
I have a link that starts with one background image and then changes on hover to another. Both background images are set in the CSS. My browsers (any of them) don't seem to load the hover image ...
15
votes
8
answers
60k
views
Font displays differently in Firefox vs. Chrome
It seems that my menu bar is displayed with a different font stretch in Firefox than it is in Chrome. See the following:
Here is the CSS applied to this element:
font-variant: small-caps;
font-size:...
15
votes
1
answer
5k
views
Is this inline-block trick involving 'font-size: 0' dangerous for SEO?
A while back, I answered this question on Stack Overflow:
https://stackoverflow.com/questions/5078239/how-to-remove-the-space-between-inline-block-elements
The problem is that elements with display:...
14
votes
3
answers
7k
views
Robots.txt - CSS allow or disallow
Are CSS and templates allowed in robots.txt?
Should it cause any problems?
In Joomla, CSS and templates are disallowed in the robots.txt. Please help me find a solution to whether or not put ...
14
votes
4
answers
6k
views
Can CSS be copyrighted?
I know CSS on a website is protected under the website's copyright since it is considered part of the overall design. I also know that images used in CSS are copyrightable.
How about when CSS is used ...
14
votes
6
answers
1k
views
How can I encourage the browser to download images from CSS file faster?
I use CSS to place a lot of my images (as backgrounds for <div>) and I often find that they load very slowly this way. They seem to be the last thing to load. Even small little icon images ...
14
votes
1
answer
1k
views
Refactoring large/old CSS files
I'm currently working on a 100,000 page website, the current design has been in place for over 5 years and successive updates have resulted in four 12,000+ line CSS files.
Obviously the CSS has ...
14
votes
4
answers
11k
views
is 'bookman old style' web safe
Is 'Bookman Old Style' web safe? If not, is there something that looks similar which is web safer?
14
votes
8
answers
4k
views
What should I use to automatically combine css/js files?
I'm aware of sprockets for combining javascript files, but haven't tried it. What are some other options and how do they stack up?
13
votes
2
answers
7k
views
Should company name in logo be an image or text?
I'm putting a logo (comprising of an image and company name) on my website. I'm not sure whether to save the company name text as part of an image file, or to have it as actual text in the html and ...
13
votes
2
answers
459
views
Communicating image size, best practice
If you are developing a html document strictly using current best practice of keeping styling out of the markup how do you best communicate image sizing?
Past best practice wants image height and ...
13
votes
1
answer
812
views
How to make a printer-friendly version of a webpage?
What solutions or techniques exist for offering users a printer-friendly versions of a webpage?
13
votes
4
answers
16k
views
iPad and iPhone browser rotating images on site?
I am experiencing an odd occurance on a site I'm building right now where images are displayed 90 degrees different from how they are supposed to, but while maintaining the normal dimensions of the ...
13
votes
2
answers
472
views
How to identlfy unused css selectors and rules for css pages which cover multiple pages and are installed locally?
I'm looking for a tool which would be able to identify unused and/or duplicate css selectors and rules, with the following two restrictions:
The tool would have to be able to analyze css pages which ...
12
votes
3
answers
4k
views
Why do oversized images appear better than images that are the correct size on the web?
I've noticed that when I use large images, and use CSS to show them at small sizes, they look much better quality than images that are the correct size. Why is this the case?
Is CSS loading the full ...
12
votes
5
answers
8k
views
Is it OK to use jQuery for responsive web design?
I have been tasked to update a site to make it responsive and appear correctly on smart phones. Unfortunately, the site in its current form isn't very easy to work with - I can't just change the CSS.
...
12
votes
7
answers
489
views
As a non-designer what are some good sites/books/tutorials for learning web design?
My graphics skills are seriously lacking. I can see when something looks nice and when it doesn't but have a hard time coming up with anything myself given a blank slate. What should I do?
11
votes
4
answers
5k
views
Should I combine js/css files into a single file?
Both YSlow and Google's Page Speed add-ons recommend combining script (and style) files into a single file each to reduce the number of HTTP requests, and I can certainly see the point of this when ...
11
votes
6
answers
5k
views
What's the best way to show a message for only IE 6 and IE 7?
What's the best way to show a text message for only IE 6 and IE 7 ?
Should I add a html tag to my webpages and normally hide it with css for all browsers except the above mentioned ?
And when I use ...
11
votes
8
answers
5k
views
CSS style viewer/tester
Is there a site out there that has a bunch of typical HTML for seeing what the CSS looks like once applied?
I mean, something full of table, a, div, span, p, whatever. You go there, paste in your ...
11
votes
1
answer
2k
views
Duplicate content on the same page - SEO ramifications?
In certain situations, I've seen Responsive Design websites with duplicate content on the same page. The pages had duplicate HTML structure and content in some parts of it due to Responsive Design.
...
11
votes
1
answer
14k
views
Google Chrome for Mac, CSS colors and display profiles
So, I'm aware that some browsers correct the colors in images in accordance with system settings, and that browsers differ in how they do this. But I'm very surprised when a color specified in a ...
11
votes
4
answers
5k
views
Is there anything wrong with targeting the alt attribute in css?
I tried targeting the the alt attribute in css. My solution worked in Firefox/Mozilla, but fails in Safari-Chrome/Webkit. Is there anything wrong with styling an alt tag? If not, how do you suppose I ...
11
votes
3
answers
1k
views
How does client side XML+XSLT affect SEO?
I have a site that is built completely in XML and is transformed by a single XSL file. How does this affect SEO? Is it possible to store page-specific metadata? Will robots see the transformed page (...
11
votes
2
answers
669
views
Automated Website Testing/Sanity/Quality
I am thinking about building a tool that starts from the root of a webpage and traverses the entire website gathering a list of resources such as CSS/HTML/Javascript files and then runs CSS/Javascript ...
10
votes
5
answers
260
views
What new cross-browser features can we use if we drop support for IE6?
My company is dropping support of IE6 and I just realize that we can use a set of great features.
Is there a list of CSS, Javascript features which we can use with IE6 RIP?
10
votes
4
answers
12k
views
How do you save or export changes made in Firebug?
Using Firebug to edit CSS, how do I save or export changes made to the CSS?
TOOLS: Firefox, Firebug
If you know of a way to lock the forward/back/refresh on a Firefox tab, please let me know. ...
10
votes
4
answers
550
views
How to go about unused CSS issues
I am running some speedtests on a blog, and I always get complaints about unused CSS. But this is not CSS that I never use, it is just not used on that particular page.
Now I work in a structured way,...
10
votes
2
answers
269
views
What are the basic things to do in order to make a web site iPhone-friendly or more mobile-accessible?
What are the basic things to do in order to make a web site iPhone-friendly or more mobile-accessible in general?
9
votes
8
answers
488
views
CSS reduction for faster loading / less bandwidth
Is compacting CSS / Removing unused rules for a specific page worthwhile in terms of bandwidth or can we rely on caching (headers/last-modified) to remove this overhead in the wild?
Cheers
Also, ...