Tag: css

55 votes
30 answers
1.3K 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;. O

avatar
Yolando
0 1 0 9
asked 07 September, 2021
64 votes
30 answers
2K 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 w

avatar
Clarice
0 1 0 9
asked 07 September, 2021
50 votes
30 answers
605 views
How to disable text selection highlighting

For anchors that act like buttons (for example Questions, Tags, Users, etc. which are located on the top of th

avatar
Corey
0 1 0 9
asked 07 September, 2021
55 votes
30 answers
824 views
How do I vertically align text in a div?

I am trying to find the most effective way to align text with a div. I have tried a few things and none seem t

avatar
Percy
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
1.3K views
Hide scroll bar, but while still being able to scroll

I want to be able to scroll through the whole page, but without the scrollbar being shown. In Google Chrome i

avatar
Arline
0 1 0 9
asked 07 September, 2021
50 votes
24 answers
2.7K views
How do I style a <select> dropdown with only CSS?

Is there a CSS-only way to style a <select> dropdown? I need to style a <select> form as much as

avatar
Shanita
0 1 0 9
asked 07 September, 2021
53 votes
30 answers
618 views
How do I make a placeholder for a &apos;select&apos; box?

I'm using placeholders for text inputs which is working out just fine. But I'd like to use a placeho

avatar
Thurman
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
2.3K views
How do I auto-resize an image to fit a &apos;div&apos; container?

How do you auto-resize a large image so that it will fit into a smaller width div container whilst maintaining

avatar
Tuan
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
1.6K views
How to align checkboxes and their labels consistently cross-browsers

This is one of the minor CSS problems that plague me constantly. How do folks around Stack Overflow vertically

avatar
Renaldo
0 1 0 9
asked 07 September, 2021
51 votes
29 answers
2.2K views
Retrieve the position (X,Y) of an HTML element relative to the browser window

I want to know how to get the X and Y position of HTML elements such as img and div in JavaScript relative to

avatar
Carmelina
0 1 0 9
asked 07 September, 2021
55 votes
24 answers
2.6K views
Vertically align text next to an image?

Why won't vertical-align: middle work? And yet, vertical-align: top does work. span{ vertical-alig

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
50 votes
30 answers
3K 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

avatar
Frederick
0 1 0 9
asked 07 September, 2021
54 votes
30 answers
2.1K 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

avatar
Vi
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
1.4K 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

avatar
Royal
0 1 0 9
asked 07 September, 2021
63 votes
30 answers
2.5K views
How do I give text or an image a transparent background using CSS?

Is it possible, using CSS only, to make the background of an element semi-transparent but have the content (te

avatar
Hilario
0 1 0 9
asked 07 September, 2021
53 votes
17 answers
1.8K 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

avatar
Fabian
0 1 0 9
asked 07 September, 2021
47 votes
18 answers
796 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

avatar
Bryan
0 1 0 9
asked 07 September, 2021
60 votes
30 answers
677 views
Set cellpadding and cellspacing in CSS?

In an HTML table, the cellpadding and cellspacing can be set like this: <table cellspacing="1" cellpadding

avatar
Patsy
0 1 0 9
asked 07 September, 2021
57 votes
30 answers
2.6K views
Change a HTML5 input&apos;s placeholder color with CSS

Chrome supports the placeholder attribute on input[type=text] elements (others probably do too). But the follo

avatar
Lashawna
0 1 0 9
asked 07 September, 2021
65 votes
30 answers
1.9K views
How to horizontally center an element

How can I horizontally center a <div> within another <div> using CSS? <div id="outer"> <

avatar
Sachiko
0 1 0 9
asked 07 September, 2021