Most anwered "css" questions
Cascading Style Sheets (or simply CSS) is a style language used to define the presentation of documents written in a markup language, such as HTML or XML. Its main benefit is to provide the separation between the format and content of a document.
Learn more…8,314 questions
Sort by count of
-
73
votes18
answers139957
viewsWhat is the best way to center an element vertically and horizontally?
What’s the best way (by "better" I mean: with the greatest possible compatibility between browsers and the simplest possible) to position an element in the center of the page, vertically and…
-
12
votes11
answers97880
viewsCenter image vertically within a div
I need to center images inside a div. I can do it horizontally with text-align:center;, but I want to centralize vertically. I tried to vertical-align: middle; and display: table-cell; and it didn’t…
-
28
votes10
answers68840
viewsHow to make a <div> occupy the entire page width but leave a gap of a few pixels on each side in CSS?
I’m trying to make a header that should fill the entire page width, but leaving a 5px gap on each side. For example: | ::::::::::::::: | | ::::::::::::::: | In this case the Pipes are the maximum…
-
11
votes10
answers360
viewsOrganization of CSS
Is there a pattern for organizing CSS? For example: .teste{font-family:"arial";font-size:18px;color:white} or .teste{ font-family:"arial"; font-size:18px; color:white } Which is the most…
-
27
votes9
answers37388
viewsWhat should I use in CSS, id, or class?
I started practicing html and css and some questions arose: When creating a style for an HTML element what should I use in CSS, class or id? What are your criteria for choosing what to use in CSS?…
-
37
votes9
answers34793
viewsInput type="password" with password display eye
I need to put a <input type="password"> with that eye of the reveal password, but it has to work as follows: User clicks on the eye and when dropping hides the characters again. Follow an…
-
17
votes8
answers45427
viewsHow to disable the scroll of a web page?
I’ve been trying to disable one-page scrolling. All I have found are type solutions: #container{ overflow: hidden; } But that’s just occult scroll bar. How I would disable scrolling, even with it…
-
7
votes8
answers5526
viewsHow to make a DIV fill all available width
I have two Ivs, one with a fixed width, 250px; which is on the left, will be a fixed menu, always on the left. And another div to the right that I want to make it 100%, whenever the user handle the…
-
36
votes8
answers309745
viewsReduce image size and maintain CSS aspect ratio
If I have a horizontal image (320x205), <div class="container"> <img src="imagem.jpg" width="320" height="205" /> </div> and I put the CSS rule .container img { max-width: 200px;…
-
23
votes8
answers44013
viewsHow to remove auto complete input from google Chrome?
I want to remove yellow background when this enabled auto complete from Google Chrome. I tried to disable auto complete by applying: autocomplete="off" and I was unsuccessful. The top image is the…
-
11
votes7
answers4242
viewsHow to reset CSS formatting?
It was not uncommon to go through situations where the browser itself interferes with the stylesheet by adding defaults parameters such as margin size and headers fonts, default line height. Is…
-
6
votes7
answers19609
viewsHow to catch an element inside an iframe?
Why doesn’t it work .contents()? How to catch an element inside an iframe as in the jQuery API example <!doctype html> <html lang="en"> <head> <meta charset="utf-8">…
-
11
votes7
answers3042
viewsHide input value
I need to hide/remove the value from my input, but I’m not getting it at all, where am I missing? Thank you very much HTML: <div class="caixa-pesquisa"> <div…
-
24
votes7
answers16899
viewsHow to create a <select> with images in the options?
I thought I could make one select simple html with image, but does not work. I’m starting to think it’s a problem with modern browsers or HTML5. CSS select#gender option[value="Prima"] {…
-
6
votes7
answers19300
viewsIncreasing modal size using bootstrap and html
I have a certain modal responsible for displaying some content of the site, however the content can not be adjusted to the modal screen, it always gets the same width regardless of the content ...…
-
40
votes6
answers20110
viewsHow to center the content of an element vertically?
I’m trying to center vertically the content of an element that has position: absolute. I was able to move the content from half down container, however, from half up the space is "left". How can I…
-
6
votes6
answers2089
viewsHow to change the bottom lines of a table alternately? With support for older browsers
My table is created with a PHP loop. I do this by PHP even adding a condition or has some better shape? if ($nomSenha == 'xxxxxxxx') { echo '<table class="pesquisaClientes">'; echo…
-
21
votes6
answers18042
viewsHow to make a Custom Scrollbar?
How to modify a scrollbar div, to appear as in the image example below (Hangouts), instead of the standard operating system scrollbar?…
-
1
votes6
answers690
viewsHow do I make a page not bug when the browser is resized?
Well, I developed a website for a school project, the problem is that when I resize the browser, the site gets all bugged out, the elements come out of their original positions and the site becomes…
-
22
votes6
answers14122
viewsHow to simulate a higher resolution screen to check the behavior of a website?
Is there any way to simulate a higher resolution screen to check how a website behaves? I currently use 1440x900 and need to test the interface at higher resolutions.
-
1
votes6
answers19014
viewsI want to align my menu to the center
#menu ul a:hover{ background: #0186ba; background: -moz-linear-gradient(#04acec, #0186ba); background: -webkit-gradient(linear, left top, left bottom, from(#04acec), to(#0186ba)); background:…
-
3
votes6
answers1855
viewsHow to create link with Hover showing strokes on the sides
What I wish to do I want to create a menu and for each link I want to apply an effect "Hover". When the user hovers the mouse will be shown strokes to the sides of the link. Image Example Follows…
-
8
votes6
answers14224
viewsDistribute list of <li> in two columns
I’m trying to create a list with 4 blocks, but they don’t align side-by-side correctly, they’re like this: I wish they’d stay that way: HTML: <li></li> <li></li>…
-
0
votes6
answers2500
viewsHover on DIV1 change DIV2 with CSS
If I have a #div1 and a #div2, and they are brothers, I know I can use the dial ~ to stylize the #div2 as follows: #div1:hover ~ #div2 { /* regras */ } Is there an equivalent selector to style the…
-
23
votes6
answers15200
viewsWhat is and how does Bootstrap work?
I did some research, but most of the articles I found are based on the assumption that the reader already has some familiarity with frameworks (which is not my case), that I still have only a vague…
-
10
votes6
answers4502
viewsHow to use two CSS attributes at the same time?
The code: <!DOCTYPE html> <html> <body> <h1 style="color:#CC0099">Um dia eu aprendo</h1> <p style="color:red">This is a paragraph.</p> </body>…
-
21
votes6
answers8730
viewsHow to create geometric shapes using CSS?
How can I make the geometric shapes below using preferably CSS? If not possible using CSS only I also accept answers with other methods.…
-
35
votes6
answers24229
viewsWhat is the difference between padding and margin in CSS?
From what I understand I see a retreat from another element when defined the properties left, top, right e bottom. There is a difference between margin and padding in the CSS? An answer with…
-
11
votes6
answers630
viewsIs there a problem compressing CSS?
I’ve been noticing that some sites have compressed CSS, I believe this only serves to load pages faster, do you have any risk in doing this? because there are some sites that use normal CSS, I…
-
2
votes6
answers4771
viewsHow to use Materialize side-Nav?
Good morning, I’m trying to make a responsive menu for my portfolio, I’m using the do materialize but when I put it fixed the side-Nav of the mobile version Uga, it gets all dark and not to click on…
-
-1
votes6
answers4426
viewsHow do I make the image 100% on the screen?
I have a website in development. Then I want it to be on the whole screen, it’s to be a responsive site, I’m using the bootstrap... It only gets full screen if I zoom 150%: Example:…
-
7
votes6
answers1015
viewsHow could I highlight the radio button that is selected?
I own this radio group which serves to specify the severity level of a given occurrence, using the colors to classify the level. Behold: <html lang="en"> <head> <meta…
-
0
votes6
answers304
viewsAlign images to the center
How do I line up these images at the center? I tried to use the <div class="text-align">, but it didn’t work <code> <section id="team"> <div class = "text-align" <div…
-
44
votes5
answers87966
viewsHow to print content inside a HTML div?
I have a page and in it the content I want to print. I created a Javascript command, but this command prints the whole page. Is there any way to print only the contents of a div?…
-
32
votes5
answers5370
viewsHow to apply ! CSS import via jQuery?
I’m trying to apply style to my element and define its importance in this way: $('div').css('height','50px!important'); But it doesn’t work, which would be the right way?…
-
10
votes5
answers16498
viewsHow can we not apply opacity to a child element?
I have a div with applied opacity, but this div has child element. I don’t want to apply opacity to those child elements, I would have some way of solving that? Example: http://jsfiddle.net/qSsC3/1/…
-
45
votes5
answers76380
viewsHow to pin a "horizontal menu" to the top of the window when scrolling the page?
I have a layout with a horizontal navigation bar at the top of the site, it is with margin-top:100px, when scrolling the page the menu should be fixed at the top of the window but with margin-top:0.…
-
7
votes5
answers2130
viewsHow to add a class to a <li> by clicking on it, leaving only it with this class?
For example: I have more than one ul with their li; If I click on a li of the first ul she has to add a class; If I click on a li of the second ul, she adds that same class. Only that does not…
-
10
votes5
answers62952
viewsHow to remove edge of input and textarea from all browsers when clicked?
Just look at the image to get an idea: When clicked this edge with blue shadow becomes visible. I think it is standard of all browser. Some solution?…
-
10
votes5
answers18134
viewsUsing jQuery, how to select elements with two CSS classes
I have a div that uses two CSS classes. Here is the HTML : <div class="box1"></div> <div class="box1 destaque"></div> <div class="box2"></div> <div class="box2…
-
5
votes5
answers213
viewsCSS Child selectors on IE8?
Today I needed to fix to IE8 in which I used the following selector to align 3 boxes horizontally. #page-content .section-servicos .box-servico:nth-child(3n+2){ margin-right:0px; } in IE8 this code…
-
11
votes5
answers10769
viewsHow to mark and unmark a row from a table by clicking on it?
When clicking on a row of a table, how to mark it by changing the color of the row background, and if you click again uncheck the background, and if you click on another row uncheck the old checked…
-
12
votes5
answers20277
viewsHow do I use @import in a CSS file?
Inside a.css style file I am using the option @import url() to call another file CSS. For example: @import url("/css/fonts.css") Both the file and the path are correct and still I can’t import that…
-
4
votes5
answers8743
viewsCenter a form vertically
I have the following screen and I can’t vertically center this form below on the screen. I define how position: absolute; and I add the top:20% and does not move! Follows my html: <header>…
-
4
votes5
answers1944
viewsPHP MVC - Adding CSS, Images etc
Hello, in my application I am having problems when I will add a css file, image or any other file that is frontend, because when I will include I need to set the whole directory of the same, for…
-
21
votes5
answers2054
viewsWhy put Javascript, CSS, and images on another server?
On most sites I noticed that they use another server to load scripts, CSS and images. Because they use?
-
1
votes5
answers501
viewsHover only on some columns
I have a table with 6 columns, but I just want to give hover in the first 4 columns. It is possible to do this? I’m using MVC 4 and bootstrap I’m already using a method in Jquery: $(".table tbody…
-
11
votes5
answers17141
viewsIgnore CSS on a particular page snippet
Let’s assume I have some CSS of the type: #foo input { background-color: black; color: white; /* seguem mais um milhão de propriedades */ text-align: center; z-index: 9000; } All input son of foo…
-
5
votes5
answers1182
viewsHTML element does not become visible
I have the following HTML: <form action="cadastro/cadastrando.php" method="post"> <div class="elemf"> <label>Nome</label> <input id="nome" type="text" name="nome"…
-
2
votes5
answers25953
views<input type="image" ...> with LINK and HOVER
I can not put an effect on a button, I have 3 images made in photoshop, one that is Normal (Link), another when you pass the mouse (Hover), and one when you click (Actived), however, I can not…