Tag: css

49 votes
30 answers
1.7K views
How do I remove the space between inline/inline-block elements?

Given this HTML and CSS: span { display:inline-block; width:100px; background-color:palevi

avatar
Vi
0 1 0 9
asked 07 September, 2021
53 votes
22 answers
942 views
What is the best way to conditionally apply a class?

Lets say you have an array that is rendered in a ul with an li for each element and a property on the controll

avatar
Rudolf
0 1 0 9
asked 07 September, 2021
53 votes
30 answers
1.4K views
Center a column using Twitter Bootstrap 3

How do I center a div of one column size within the container (12 columns) in Twitter Bootstrap 3? .cente

avatar
Hilario
0 1 0 9
asked 07 September, 2021
61 votes
30 answers
618 views
Maintain the aspect ratio of a div with CSS

I want to create a div that can change its width/height as the window's width changes. Are there any CSS

avatar
Lorenzo
0 1 0 9
asked 07 September, 2021
63 votes
30 answers
2.1K views
How to make Twitter Bootstrap menu dropdown on hover rather than click

I'd like to have my Bootstrap menu automatically drop down on hover, rather than having to click the menu

avatar
Rudolf
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
1.9K views
How can I center an absolutely positioned element in a div?

I need to place a div (with position:absolute;) element in the center of my window. But I am having problems d

avatar
Virgil
0 1 0 9
asked 07 September, 2021
50 votes
10 answers
2.2K views
Which characters are valid in CSS class names/selectors?

What characters/symbols are allowed within the CSS class selectors? I know that the following characters are i

avatar
Scot
0 1 0 9
asked 07 September, 2021
54 votes
27 answers
2.4K views
How to align content of a div to the bottom

Say I have the following CSS and HTML code: #header { height: 150px; } <div id="header"> &l

avatar
Wei
0 1 0 9
asked 07 September, 2021
54 votes
19 answers
1.8K views
What is the difference between visibility:hidden and display:none?

The CSS rules visibility:hidden and display:none both result in the element not being visible. Are these synon

avatar
Margo
0 1 0 9
asked 07 September, 2021
64 votes
19 answers
1.7K views
How do I combine a background-image and CSS3 gradient on the same element?

How do I use CSS3 gradients for my background-color and then apply a background-image to apply some sort of li

avatar
Jesenia
0 1 0 9
asked 07 September, 2021
56 votes
30 answers
641 views
Font scaling based on width of container

I'm having a hard time getting my head around font scaling. I currently have a website with a body font-

avatar
Elicia
0 1 0 9
asked 07 September, 2021
64 votes
30 answers
2.8K views
How can I vertically center a "div" element for all browsers using CSS?

I want to center a div vertically with CSS. I don't want tables or JavaScript, but only pure CSS. I found

avatar
Lawanda
0 1 0 9
asked 07 September, 2021
67 votes
23 answers
717 views
Is there a "previous sibling" selector?

The plus sign (+) is for selecting the next sibling. Is there an equivalent for the previous sibling?

avatar
Solomon
0 1 0 9
asked 07 September, 2021
46 votes
30 answers
3K views
How to vertically align an image inside a div

How can you align an image inside of a containing div? Example In my example, I need to vertically center the

avatar
Corey
0 1 0 9
asked 07 September, 2021
53 votes
7 answers
1.6K views
Sass Variable in CSS calc() function

I'm trying to use the calc() function in a Sass stylesheet, but I'm having some issues. Here's

avatar
Kisha
0 1 0 9
asked 07 September, 2021
51 votes
30 answers
2.7K views
Transitions on the CSS display property

I'm currently designing a CSS 'mega dropdown' menu - basically a regular CSS-only dropdown menu

avatar
Dorinda
0 1 0 9
asked 07 September, 2021
55 votes
17 answers
1.6K views
Click through div to underlying elements

I have a div that has background:transparent, along with border. Underneath this div, I have more elements. C

css
avatar
Margo
0 1 0 9
asked 07 September, 2021
54 votes
22 answers
1.2K views
How do CSS triangles work?

There're plenty of different CSS shapes over at CSS Tricks - Shapes of CSS and I'm particularly puzz

avatar
Freida
0 1 0 9
asked 07 September, 2021
52 votes
24 answers
2.2K views
How to change the cursor into a hand when a user hovers over a list item?

I've got a list, and I have a click handler for its items: <ul> <li>foo</li> <l

css
avatar
Percy
0 1 0 9
asked 07 September, 2021
52 votes
15 answers
2.3K views
What&apos;s the difference between SCSS and Sass?

From what I've been reading, Sass is a language that makes CSS more powerful with variable and math suppo

avatar
Shantay
0 1 0 9
asked 07 September, 2021