This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
what's the difference between padding and margin?
Well, what's the difference? I haven't really understand it...
At it's simplest, padding = inside spacing, margin = outside spacing.
Try it.
<div style="border:1px solid red;padding:8px;margin:8px;width:200px;">TEST</div>
The width of this element will be 2 (border) + 16 (margin) + 16 (padding) + 200 (declared width) for a total 234px.
Related
This question already has answers here:
Can I create a div with a Curved bottom?
(5 answers)
Curve bottom side of the div to the inside with CSS
(2 answers)
How to create uneven rounded sides on a div?
(1 answer)
Closed 1 year ago.
I'm bad with font end design and i'm trying to make a footer with a specific shape in css. Here is the shape i want to have:
Do you know how to do it ? And if it is possible with a responsive behaviour.
I tried border-radius:
border-top-left-radius: 50% 20%;
border-top-right-radius: 50% 20%;
But the it is not what i expected.
Thanks a lot for your time.
the easy way you can achieve this is to create import the curve as image an use it for footer background.
or you can use:
border-redius
This question already has answers here:
Expand a div to fill the remaining width
(21 answers)
How to build a 2 Column (Fixed - Fluid) Layout with Twitter Bootstrap?
(2 answers)
Closed 2 years ago.
I try to get two divs in a row. One fixed (220px), the other fills the rest of the page so it's always 100% in total.
I've also read similar threads like this one:
Two divs in one row
I tried several approaches, Bootstrap, Flexbox, Floating Divs, in the end I used calc, but I couldn't get 100% accurate results.
My favorite approach would be with Bootstrap, but I couldnt get this to work, no matter if with a grid or other options.
The actual approach seems kinda messy: Whenever I use calc() and substract the same width of the first container, it's displayed in a second row. Only when I substract 4px more, it's shown in the same line.
I guess this is the right and the left border of both divs or so. There's also a little margin between the divs, even if I set margin to 0px.
<div style="width:220px; display:inline-block; background-color:#F00; margin: 0px;">
1
</div>
<div style="width: calc(100% - 224px); display:inline-block; background-color:#FF0; margin: 0px;">
2
</div>
My question is easy: How can I do this accuratly?
This question already has answers here:
font-size vs line-height vs actual height
(2 answers)
Closed 4 years ago.
Someone probably had the same issue, but can't find anything. It seems like line-height css doesn't match the actual height of the line
Here is the text css properties:
.description{
line-height:17px;
font-size:14px;
height:85px;
overflow:hidden;
}
so normally, since 17px * 5 = 85px, we should only see 5 lines, but as you can see on the pic, the top of the next line is showing up. It behave like if line-height is about 16.7px and not 17px. Is there a way to correct that?
I try with different height (102px, 170px, etc..) , and the higher the box is, bigger the gap is (at 255px, we can see half of the next line )
Update: A comparison of my result with 255px box (issue) and the expected result (like jsfiddle)
js fiddle : https://jsfiddle.net/eo7pkzqt/28/
Refer this
See line-he is depended on font-size,font-family....etc so variation comes using line-height
This question already has answers here:
How to make a div fill a remaining horizontal space?
(26 answers)
Closed 7 years ago.
I have 2 Divs. They are both floating left and div1 has a variable.
#div1: 8%;
The HTML is:
<div class="div1">Icon</div>
<div class="div2">Big Text</div>
Can I tell the div2 that it has to use the rest of the width? So, in this case that should be 92%. How can I do this without creating a second variable? The 2 divs together have to be 100% wide.
In all seriousness, it would've been faster for you to either try or read the starters manual than to ask this question.
#div1: 8%;
.selector {
width: 100% - #div1; //Evaluates to 92%
}
This question already has answers here:
Control the dashed border stroke length and distance between strokes
(11 answers)
Closed 4 years ago.
Does anybody know can I change ratio length of line and blank space in dashed border ( ratio line/blank space to be different ) ?
If you're open to using css3 you can look into the border-image property.
http://www.css3.info/preview/border-image/