Questions tagged [css]
CSS (Cascading Style Sheets) is a representation style sheet language used for describing the look and formatting of HTML (HyperText Markup Language), XML (Extensible Markup Language) documents and SVG elements including (but not limited to) colors, layout, fonts, and animations. It also describes how elements should be rendered on screen, on paper, in speech, or on other media.
807,001
questions
6107
votes
45
answers
2.7m
views
How to disable text selection highlighting
For anchors that act like buttons (for example, the buttons on the sidebar of this Stack��Overflow page titled Questions, Tags, and Users) or tabs, is there a CSS standard way to disable the ...
5105
votes
128
answers
4.9m
views
How can I horizontally center an element?
How can I horizontally center a <div> within another <div> using CSS?
<div id="outer">
<div id="inner">Foo foo</div>
</div>
4397
votes
42
answers
2.0m
views
Change an HTML input's placeholder color with CSS
Chrome v4 supports the placeholder attribute on input[type=text] elements (others probably do too).
However, the following CSS doesn't do anything to the placeholder's value:
input[placeholder], [...
4228
votes
33
answers
3.6m
views
Is there a CSS parent selector?
How do I select the <li> element that is a direct parent of the anchor element?
As an example, my CSS would be something like this:
li < a.active {
property: value;
}
Obviously there are ...
3700
votes
19
answers
2.7m
views
Set cellpadding and cellspacing in CSS?
In an HTML table, the cellpadding and cellspacing can be set like this:
<table cellspacing="1" cellpadding="1">
How can the same be accomplished using CSS?
3299
votes
22
answers
1.8m
views
How do I disable the resizable property of a textarea?
I want to disable the resizable property of a textarea.
Currently, I can resize a textarea by clicking on the bottom right corner of the textarea and dragging the mouse. How can I disable this?
3182
votes
20
answers
293k
views
Is it possible to apply CSS to half of a character?
What I am looking for:
A way to style one HALF of a character. (In this case, half the letter being transparent)
What I have currently searched for and tried (With no luck):
Methods for styling half ...
2919
votes
44
answers
1.8m
views
How can I transition height: 0; to height: auto; using CSS?
I am trying to make a <ul> slide down using CSS transitions.
The <ul> starts off at height: 0;. On hover, the height is set to height:auto;. However, this is causing it to simply appear, ...
2919
votes
16
answers
2.4m
views
I need an unordered list without any bullets
I have created an unordered list. I feel the bullets in the unordered list are bothersome, so I want to remove them.
Is it possible to have a list without bullets?
2783
votes
43
answers
1.9m
views
Make a div fill the height of the remaining screen space
I am working on a web application where I want the content to fill the height of the entire screen.
The page has a header, which contains a logo, and account information. This could be an arbitrary ...
2770
votes
37
answers
4.4m
views
How do I vertically center text with CSS? [duplicate]
I have a <div> element which contains text and I want to align the contents of this <div> vertically center.
Here is my <div> style:
#box {
height: 170px;
width: 270px;
...
2676
votes
43
answers
2.8m
views
How to make a div 100% height of the browser window
I have a layout with two columns - a left div and a right div.
The right div has a grey background-color, and I need it to expand vertically depending on the height of the user's browser window. Right ...
2626
votes
15
answers
1.0m
views
What is the difference between margin and padding in CSS?
What is the difference between margin and padding in CSS? When should one or the other be used?
2539
votes
30
answers
1.6m
views
How do I reduce the opacity of an element's background using CSS?
Is it possible, using CSS only, to make the background of an element semi-transparent but have the content (text & images) of the element opaque?
I'd like to accomplish this without having the ...
2504
votes
44
answers
1.9m
views
How can I make a div not larger than its contents?
I have a layout similar to:
<div>
<table>
</table>
</div>
I would like for the div to only expand to as wide as my table becomes.