css-float

How to float elements inside a container

一世执手 提交于 2021-02-04 21:57:58
问题 I am trying to put the #container in the center of the screen and make the 'charts' float:left inside the #container . But with the code I have below, the 'charts' locate under the #container . Can anyone tell me how can I change the code? And tell me why the code make the 'charts' outside the #container . #container { margin: auto; width: 10%; border: 3px solid #73AD21; padding: 10px; } #id1, #id2, #id3, #id4 { float: left; font-size: 30px; } <div id="container"> <div id="id1"> <p>chart1</p>

How to float elements inside a container

怎甘沉沦 提交于 2021-02-04 21:55:09
问题 I am trying to put the #container in the center of the screen and make the 'charts' float:left inside the #container . But with the code I have below, the 'charts' locate under the #container . Can anyone tell me how can I change the code? And tell me why the code make the 'charts' outside the #container . #container { margin: auto; width: 10%; border: 3px solid #73AD21; padding: 10px; } #id1, #id2, #id3, #id4 { float: left; font-size: 30px; } <div id="container"> <div id="id1"> <p>chart1</p>

Trying to align an image to the right middle of a column in bootstrap

我怕爱的太早我们不能终老 提交于 2021-01-29 05:42:40
问题 I'm trying to align an image in my bootstrap column to the right and have the text wrap around it on the left like this: https://codepen.io/freeCodeCamp/full/YqLyXB I've been researching flexbox and vertical align all day instead of doing my job (woops) and feel like it's time to just ask the experts. Here's what mine looks like: https://codepen.io/Seaplush/pen/rKVLmX .col2 img{ max-width: 100%; height: 50%; float: right; } .col2{ background-color: #cccccc; height: 50vh; display: flex; flex

CSS: Vertically Align Text next to Icon using Floating Divs

陌路散爱 提交于 2021-01-28 02:37:18
问题 I'm trying to align a Text next to an Icon/Image, I want the text or the image to be align vertically but the vertical-align is not being applied, it might have something to do with the floats Here's an image explainng what I want to do: Here's what I have so far: ---- HTML --- <ul class="toolboxItems"> <li> <div class="image"> <img src="someImage.png"> </div> <div class="label"> <label>Lorem ipsum dolor sit amet....</label> </div> <li> <li> /* more of the same .... */ </li> <ul> ---- CSS ---

child div goes outside parent div

允我心安 提交于 2021-01-27 06:29:35
问题 Currently I am designing a website using CSS and HTML etc. But I have faced a problem there : my child div goes outside the parent div when I add floating to the child. The site resides here my web design 回答1: Be more specific. Where is the problem on the website? Try to add this to css, so parent will know about the size of the child element: #parent{ overflow:hidden; } 回答2: You need to clear after your float. Try adding this css: CSS .container:after { content: ""; display: table; clear:

child div goes outside parent div

淺唱寂寞╮ 提交于 2021-01-27 06:29:07
问题 Currently I am designing a website using CSS and HTML etc. But I have faced a problem there : my child div goes outside the parent div when I add floating to the child. The site resides here my web design 回答1: Be more specific. Where is the problem on the website? Try to add this to css, so parent will know about the size of the child element: #parent{ overflow:hidden; } 回答2: You need to clear after your float. Try adding this css: CSS .container:after { content: ""; display: table; clear:

How do I display 2 sections side-by-side? [duplicate]

筅森魡賤 提交于 2020-12-29 11:45:26
问题 This question already has answers here : Two divs side by side - Fluid display (8 answers) Closed 3 days ago . I have following HTML code: <section class="indent-1"> <!-- Section 1 --> <section> <div>Some content</div> <div>Some more</div> </section> <!-- Section 2 --> <section> <div>Some content</div> <div>Some more</div> </section> </section> And I'd like to display Section 1 on the left and Section 2 on the right instead of vertically like they normally appear. The parent section

How do I display 2 sections side-by-side? [duplicate]

£可爱£侵袭症+ 提交于 2020-12-29 11:44:05
问题 This question already has answers here : Two divs side by side - Fluid display (8 answers) Closed 3 days ago . I have following HTML code: <section class="indent-1"> <!-- Section 1 --> <section> <div>Some content</div> <div>Some more</div> </section> <!-- Section 2 --> <section> <div>Some content</div> <div>Some more</div> </section> </section> And I'd like to display Section 1 on the left and Section 2 on the right instead of vertically like they normally appear. The parent section

Why is the floated element overlapping the element below and not the other way round?

你离开我真会死。 提交于 2020-12-26 05:00:29
问题 div { background-color: #00FFFF; } p { width: 50px; height: 50px; border: 1px solid black; margin: 0px; } #p1 { background-color: red; float: left; } #p2 { background-color: green; } #p3 { background-color: orange; } #p4 { background-color: yellow; } span { position: relative; } #s1 { top: 1px; left: 1px; } #s2 { top: 2px; left: 2px; } #s3 { top: 3px; left: 3px; } #s4 { top: 4px; left: 4px; } <h1>Floating Elements</h1> <div> <p id="p1"><span id="s1">A</span></p> <p id="p2"><span id="s2">B<

CSS float right not working correctly

核能气质少年 提交于 2020-08-24 05:10:24
问题 My right float is not working how i expect it to. I want my button nicely aligned to the right of my text above a line : <div style="padding: 5px; border-bottom-width: 1px; border-bottom-color: gray; border-bottom-style: solid;"> My Text <button type="button" class="edit_button" style="float: right; margin:5px;">My Button</button> </div> However it always seems to hover over the line. If I increase the padding or margin of the DIV then the button on the right still seems to be pushed over the