Most viewed "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
-
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;…
-
33
votes3
answers154319
viewsHow to center horizontally one div within another?
How can I center a horizontal div that is inside another div using only CSS? In this case, we can assume that div external outer has a width of 100%. <div id="outer"> <div…
-
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…
-
13
votes2
answers127257
viewsPut a background image and make it responsive
I’m having a problem putting a background image on my page. I did some tests and it looks like this when I change the window size: When I maximize it’s right: How can I adjust this image to get the…
-
2
votes3
answers122074
viewsPlace text next to image
I’m trying to put an image and a text on the side, but I’m not getting it. The text is under the photo or I can put the first sentence of the text on the same level as the top of the image on the…
-
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…
-
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?…
-
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.…
-
3
votes3
answers75169
viewsCentralize Divs - Bootstrap
Well, I divided the content part into two Ivs, col-Md-6, only they’re not centered in relation to the site, even though they’re in the center, they’re on the left side, leaving the right side a…
-
37
votes2
answers71704
viewsHow to make image responsive
I am working on a site with responsive feature and in it I have a promotions page and I would like the images to follow the browser size change, the maximum size of the image width is 1080px,…
cssasked 9 years, 7 months ago adventistapr 5,498 -
6
votes2
answers71487
viewsApply opacity only in background
I have a div and text written inside her. .topoMenuSegmentos { width: 470px; height: 190px; background-color: #0a1737; display: block; margin-top: -2px; } I want to apply a opacity:0.8, what happens…
cssasked 9 years, 10 months ago Felipe Viero Goulart 3,693 -
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…
-
5
votes3
answers63205
viewsImage with 100% width
I have the following CSS statements applied to an element: .minhaClass { float:left; width:100%; height:560px; background:url(../imagens/corpo/imagen.jpg) repeat-x top center; } This will happen on…
-
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?…
-
28
votes4
answers62720
viewsHow to style a "file" input?
I have this structure: <section id="cadastro" class="cadastroVersao pg-i"> <div class="titulo"> <h1><i class="icon-clientes"></i>Cadastro de versão</h1> <a…
-
3
votes3
answers60168
viewsHorizontal line in the middle of an unordered HTML list
I have an unordered list that has some list items and would like to place a horizontal line (horizontal Rule < hr >) on it, right in the middle, with height of 2px. I tried to put…
-
10
votes4
answers58562
viewsCss comments with // instead of /* */
Place // at the beginning of a line creates an invalid property, i.e., CSS ignores that line. div { background-color: cyan; // background-color: red; } I know the CSS standard is using /* */, but…
-
-1
votes2
answers58434
viewsBackground image, using css
How do I put a background image on div, using css? I tried using simple quotes but nothing happened: background: url('images/html.jpg'); I’m doing so in the: #tudo { width: 100%; height: 992px;…
-
7
votes2
answers56156
viewsHow to center all content of a div - Bootstrap
Hello. I am learning how to use the bootstrap. In my studies I had a question. If there’s any way to centralize the entire contents of a div. I have sample codes... <!DOCTYPE html>…
-
25
votes1
answer55331
viewsHow to style the scroll bar?
Good, I’ve been spending some time looking for solutions to this but I can’t find it, I have a scrollbar And I’d like to take your size down. Can someone point me to a website or tell me what it…
-
2
votes2
answers52643
viewsHow to make a background image fill the entire screen without losing image resolution
I have a part on my site where I need to put a background image occupying the entire screen, both wide and high. I managed to do this with css. .intro { display: table; width: 100%; height: 100%;…
-
5
votes1
answer51746
viewsAlign multiple Divs horizontally within a container
I have several div with float: left inside another div, which is their container, according to code: <div id="container"> <div id="box-1" class="box">1</div> <div id="box-2"…
cssasked 10 years, 3 months ago Tiago César Oliveira 2,855 -
4
votes4
answers51666
viewsResponsive font-size depending on screen size
Can anyone explain/teach me how to make my text increase or decrease along with the screen dimension? I read a little about REM, but I didn’t quite understand. I don’t even know if that applies to…
-
11
votes2
answers51084
viewsSliding effect on anchor links
I have a page Onepage and the anchor links of the menus when clicked them only "jump" to the screen section further down, but I wanted them to slide smoothly up to the intended anchoring section. I…
-
4
votes3
answers49868
viewsOverwrite image with a DIV
How do I place a DIV over a <'img image'> ? HTML <div id="main-banner"> <img src="images/wall.jpg" /> <div id="main-banner-content"></div> </div> CSS #main-banner…
-
2
votes3
answers49805
viewsPlace a div next to each other
I’m having a little problem with CSS, I wanted a div to side with each other. I’ve tried to float both, but if I do this the footer div goes up. What I do? #DivRodape{ position: absolute; top: auto;…
cssasked 6 years, 9 months ago user99595 -
2
votes2
answers48943
viewsHow to change the color of a single link?
How to change the color of a single link? I’ve tried to go on "Modify - Page properties - Links", however the settings that are put there go to ALL links, and is not what I want on my site.…
-
1
votes3
answers48417
viewsMake text have line break inside the div
Good need to make the text that is within the class div txt has line break. Follow the example of the code I have to change. .font-15, input, textarea, select, .container-head, .se-pre-con p,…
cssasked 7 years, 8 months ago Hugo Borges 5,294 -
5
votes5
answers47771
viewsCentralize a table (HTML)
I made a table in mine HTML, but I couldn’t center it in the middle of the screen. She’s vertical and I’ve tried putting the text-align:center but it didn’t help. td, th { padding: .7em; margin: 0;…
-
8
votes4
answers47612
viewsPin the footer of an html page and follow the page content
I need to pin the tag footer at the end of the html page, but when the content exceeds the page by tag footer should follow the content and not be fixed. See the CSS code is the HTML code I’m using…
-
-3
votes1
answer46906
viewsHow to change menu colors?
When we create a menu with Bootstrap, it by default, creates a black band throughout the menu area. It looks beautiful like this. However, in the company I’m in, the predominant color is magenta, so…
-
4
votes3
answers46491
viewsPath to access html folders ,css,php etc
Could someone explain me this Nives system to access folder in the use of languages like html,css and php (../)(.../)(./).?
-
3
votes3
answers46057
viewsFooter at the end of the document
I am trying to leave the footer at the end of the document, but it is at the end of the page I am viewing, thus hindering the usability of the system... Follow the footer: <div class="container…
-
6
votes2
answers45970
viewsLimit text display by number of CSS characters
Friends, usually the overflow: hidden; has a text limit by the size of the DIV from it, say 105 pixels... example: <div style="overflow: hidden; width:105px; border:1px; white-space:nowrap;">…
-
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…
-
8
votes3
answers44043
viewsHow to put icon inside input using Font Awesome?
I’m trying to make a search field with an icon using Font Awesome, I want it to look like this: but he gets like this: What is the best way to put the button within the input? HTML: <form>…
-
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…
-
6
votes3
answers42780
viewsHow to change date format in bootstrap from mm/dd/yyyy to dd/mm/yyyy
That’s the mistake you’re making: Uncaught Typeerror: Cannot set Property 'en-BR' of Undefined Insert some links to format the date, according to what I took on the net and even then the date is…
-
5
votes3
answers41543
viewsAlignment from side to side
I want to put both divs (green and red) aligned side by side as they are, but the green should be fixed aligned on the right, while the red line is aligned on the left, so I put the margin-left:0vw;…
-
5
votes2
answers40895
viewsValidate input to only receive numbers with jquery?
I need this input to receive only numbers: <input class="form-control input-sm " placeholder="número" maxlength="4" type="text" ng-model="numero.nJogo" /> This I need to receive only values…
-
49
votes2
answers40509
viewsWhen to use Absolute or relative position in CSS?
I know an element inside with position absolute does not respect the boundaries of the parent div and that relative respects, and theoretically positions itself in relation to itself. My doubts are…
-
4
votes2
answers40440
viewsHow to resize image to container size?
I have a div with 1184x308px and I want to place inside images that are dynamic. Since images can be loaded with any dimension, how can I adjust the dimensions of the div?…
-
2
votes2
answers40368
viewsAlignment of text inputs in HTML/CSS
How do I align these two input? I’ve been trying for over two days and I can’t get them to line up properly.…
-
47
votes4
answers40074
viewsWhat is the difference between display:None and visibility:Hidden?
I know you’re both hiding the element, but there’s actually a difference between: #foo{ display:none; } and #foo { visibility:hidden; }…
-
1
votes2
answers39475
viewsImage alignment to the right of the div in Bootstrap
I know what central and center-block alignment is in bootstrap, but I’d like to know how to line up a picture to the right of a div? I’m unable to place the phone image next to the number, I have to…
-
36
votes4
answers39339
viewsHow to apply readonly in a select?
I believe most of you here know the difference between readonly and disabled. Select Readonly The readonly does not apply properly to the select <select name="field" readonly="readonly">…
-
5
votes2
answers39330
viewsHow to make a vertical line
Hi I was wondering how does a vertical line with this code: <hr> She by default is horizontal, really wanted her vertical, anyone know how it does? I just wanted this code because I have it…
-
0
votes3
answers38537
viewsAlignment of buttons with css
Well I have here the personalities buttons with CSS. I need them to always stay in the center of the page, if I put several buttons they have to stand in a queue in the center of the page. And when…
cssasked 7 years, 9 months ago Hugo Borges 5,294 -
4
votes1
answer38536
viewsHow to take the blue color out of links by ultializing CSS?
My teacher asked me to recreate the pages of G1, Globe Sport and Walmart. He wants the links "dead, so I use the <a href="#">. The problem is that there the contents of a turns blue, and the…
-
3
votes3
answers38304
viewsPosition DIV in the center of the page
How do I align the div with black and transparent background where it contains the buttons in the center of the page independent of the monitor resolution? The code I’m using is this: .fundo{…