Most voted "div" questions
The HTML div element is semantically neutral, and often used for grouping content for styling, and for content that cannot be described semantically by any other element.
Learn more…298 questions
Sort by count of
-
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?…
-
34
votes9
answers166445
viewsHow to hide/show a div in HTML?
How do I make a Javascript that shows/hides a div in HTML? I tried like: function Mudarestado(divid) { var disp = document.getElementById(divid).style.display; disp = "none; // (ou disp = "block") }…
-
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…
-
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…
-
11
votes3
answers3924
viewsInsert external video or HTML or JS into a div
On the site I’m developing, I’d like to call an external video within a div, just using the video ID. Example: https://www.youtube.com/watch?v=UJAwNkhbYWM In this case the video ID is this:…
-
9
votes1
answer51550
viewsScroll in div if necessary
I have the following div on my page html <div id="divContent" class='content'> Bem vindo ao meu site <br /> 1 index index index index index index index index <br /> 2 index index…
-
8
votes5
answers48166
viewsHow to increase or decrease the div proportional to 720x540?
I’m trying to solve this question because I have a slide on. ppt with dimensions of 720w and 540h and my page is net, so the reason for increasing or decreasing proportionally. Example:…
-
8
votes4
answers24849
viewsCSS DIV diagonal
I recently received a layout to develop, in which I have a specific part that I can not do, I need a div that is inclined, as in the example, more than its text flows normally, the text is not…
-
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…
-
7
votes3
answers490
viewsDisplays and hides contents in list form. with Javascript
I’m trying to make a list of Youtube videos as follows. (ps:Eu sei que o Youtube ja tem uma playlist dele.) Example: List with video names. 1 - Trailer Reaction: Star Wars: Episode VII - The Force…
-
7
votes4
answers2176
viewsWhat are they for and why do they nest the DIV tag?
To TAG <div> is one of the most visualised within a file HTML, it is used within the beginning of the TAG <body> the closure of the </body>, as an example: <body>…
-
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>…
-
6
votes6
answers5183
viewsHow to reverse the position of a div(and its content and attributes) with another div?
I wish to do this with jQuery, which is the most elegant way to do it? Assuming the following scenario, how would it look if I wanted to switch from position to div2 to div3? (I will not post my…
-
6
votes0
answers92
viewsIs there anything that gives you the path to CSS?
I need something to make me reference the path of CSS faster, like a feature in Google Inspect, because it’s hard to keep finding the sequences of hundreds of divs inside divs. Like something that…
-
6
votes2
answers2044
viewsHow to keep Ivs aligned on top of each other?
- I am extremely new to the subject and do not know much, I am going from searches on the internet, videos and readings, I say this in case there is some code or unnecessary rule in my doubts I…
-
5
votes1
answer3362
viewsHow to create an empty block?
How do I create an 800px high EMPTY+TRANSPARENT block per 1000px width? And because the code below doesn’t work for that? html <div class="block"></div> css .block { height: 800px;…
-
5
votes4
answers1991
viewsDifference between span img and div img
I’ve seen it in some source code: <span> <img="../imagens/1.jpg"></span> and in others: <div> <img="../imagens/1.jpg"></div> Is that wrong? I always thought…
-
5
votes2
answers2638
viewsUpdate Div HTML PHP Javascript
I’m having some problems updating a div without updating the full page. Follows the code: <div class="main" align="justify"> <div id="mensagens"> <?php echo…
-
5
votes1
answer578
viewsDynamically create Divs
Sirs, I am working with tabs in Jquery. I have a page called inclu_server.php where I do the Insert in the database of as many servers as I want. I need that after clicking the button next the…
-
4
votes2
answers133
viewsWhen using div+selector in CSS
Whenever I am developing the front-end of some site, I put the name of the selector, for example .seletor1, .seletor2 and so on. Recently I had to change the classes of a plugin I downloaded, and I…
-
4
votes3
answers688
views -
4
votes1
answer1153
viewsGet information from a div in C#
Well, I have a code that reads the page but I need the following: <a href="/t848p15-teste">2</a> The idea of the code is to look for a tag <a> that has this 2 and return the link.…
-
4
votes4
answers82
viewsDoubt with height in a DIV
I have a problem that seems very simple to me and I’ve done it before, but I just don’t remember how! Assuming a page with 3 Ivs (header, content and footer) how do I make the content div take up…
-
4
votes1
answer2826
viewsHow to update a DIV with Ajax/JS?
I am in the development of a page, but I am completely secular in the matter of JS... The site has the div with the ID #content, and inside it a refresh button. How can I make it so when someone…
-
4
votes2
answers966
viewsHide a div when showing another
I’m having a problem hiding one div when I show another. If I use .conteudo_up instead of the id2 I can do this effect, but it does for everyone at the same time and I want for each one…
-
4
votes2
answers85
viewshelp here div and html functions
I have this code, when I pass the mouse over the div it moves, but I wanted it to happen when I hit the button: <head> <style> .square{width:100px ;height:100px ;background:red…
-
4
votes3
answers1279
viewsIs there any way to make a div son, float while rolling the scroll of the father div?
I have a div primary, and within this, another div(secondary). I’m trying to position the div secondary in div so that it makes a floating DIV (popup style) that overlaps with other elements. But…
-
3
votes5
answers59481
viewsTake content from within a Div and put in Input value
I have a form, and inside it I have an input, which will have to take what it contains inside a DIV, which in case is only text. The input is like this: <input class='formContato' type='text'…
-
3
votes1
answer94
viewsMake DIV occupy page remnant with CSS
Good guys, I have a div#x that varies your width amid 70px ~ 220px. I need a second div#y, who is next to you occupies the rest of the page space. With jQuery it would be something like:…
-
3
votes2
answers394
viewsChange image size and box with %, not working
I have a layout, where I have a div with an image, and a class with a box over that image, the same size as that image, and I apply a transition on top of this box to reveal it when positioning the…
-
3
votes2
answers485
viewsCompare id attribute with class and give . show in another div
I’m making a map of brazil as svg, need that when I click on a certain state it gives a show in a different div that will have the information about that state. I need to compare path id with div…
-
3
votes1
answer572
viewsHow to use two css files in an html
How can I use two CSS files in an HTML file, but one of the CSS files is only used in one div. I have a CSS file to style the page, but I needed another CSS file to style a div in the middle of the…
-
3
votes2
answers912
viewsProblems with special characters in Asp.net GRIDVIEW
I am building a dynamic GRIDVIEW, where the information of each TD will be a DIV. exemplo: <td><div id="d1" class="redips-drag t1">z</div></td> I am filling the valve as…
-
3
votes1
answer161
viewsDIV does not appear in the CHROME and IE browser
I’m trying to solve a CSS in my development: HTML: I created a Responsive DIV with 1 COLUMN (GRID of 6) for a specific content section. I already put text inside this. CSS: I created a class to…
-
3
votes2
answers998
viewsAnimation when changing the display into HTML
Hello my dear programmers friends of this our Brazil! I need your help on the following question: I have a button that when pressed changes the display from a div to block. So: CSS #form-pergunta {…
-
3
votes4
answers18367
viewsApplying opacity in a Background
I’m trying to apply opacity to my background image. I’ve tried using rgba, and the pseudo-class after. Is there any other way to apply this filter only to the image without affecting the content?…
-
3
votes2
answers1129
viewsCentralize objects within the div
What is the best way to centralize objects within a div horizontally and vertically, being a responsive div with no fixed size, with width and Eight in %. Div is inside a bootstrap Row div…
-
3
votes1
answer664
viewstooltip cut by div
Good morning guys. I’m trying to create a css-only tooltip on a right-side panel of the page. In this panel appears a list of users and each tooltip presents a brief profile, quite similar to the…
-
3
votes2
answers852
viewsAlign height 3 Divs in a row - bootstrap
I have 3 Ivs on a Row, but some get different heights according to the contents of the div. How to standardize the height of the div. (I do not want to fix height but rather that they are the same…
-
3
votes1
answer80
viewsImage does not appear 100%
I’m trying to create a LandingPage but the first image is being cut I’m using this CSS: .parte1 { min-height: 100%; max-height: 100%; padding-top: 50px; padding-bottom: 50px; text-align: center;…
-
3
votes1
answer876
viewsNavbar Collapse bootstrap does not push other div down
Guys, here’s the thing, I’m using the responsive bootstrap menu and I needed to click on the icon on the menu, to show the list ne by pushing the other Ivs down.... but when I click the list this…
-
3
votes4
answers5284
viewsHow to center the elements within a div?
I’m trying to align the elements that are three circles with their respective descriptions within my div center using the following class: .center { margin:auto; } However, I did not succeed in this…
-
2
votes3
answers16599
viewsFixed div when scrolling down page
I’d like to know how to leave one div fixed on the side when scrolling the page down. What I want to do is exactly like the side newsletter of that page.. . When rolling down you’ll understand…
-
2
votes2
answers734
viewsTake the url of the first image of each post (div), store this url in a variable
I have a blog, and for each post is automatically created a div. On the home page only the first image of the post and the title (with link) referring to the post should be displayed. Only here, I’d…
-
2
votes1
answer797
viewsError printing echo php in div
I’m an amateur programmer and I’m having a problem printing an eco php inside a div. I have a file that when accessed (only once) will start the database installation:…
-
2
votes2
answers2417
viewsAuto Mouse click on a content within a div?
I wonder if it is possible to make a div with auto click. That would be how the page loads and when someone clicks on any part of the page the mouse will click on the content inside the div. in case…
-
2
votes2
answers360
viewsReturn Divs to start position
At this time the drag3 always returns the initial position, except when it is placed in the drop1. In the complete game it has 4 drag s and 4 drop s but just 1 of each for example and give to…
-
2
votes0
answers895
viewsUpdate form and div data from the same page by clicking a button
I have a page that has a form and an image. This form consists of 3 buttons that access "hints", a field for response, and button for "Check Answer" and "Next Question", and a field "Score". Well,…
-
2
votes2
answers3084
viewsSwap div of place with jquery
Let’s say I have one div Mom, and inside that div I have another 3. And a Button. <div id="mae"> <div id="a" class="child"></div> <div id="b" class="child"></div>…
-
2
votes5
answers3537
viewsMake div disappear
I have a code that only works if it keeps one <div id="panel">, but would not like it to appear on the screen. It has to keep this div, but let it invisible?