How to remove the blank between div.sons?
Tags: html,css
Problem :
Three div.sons were put vertically with no blank between them. Here is the css code and displayed image.
<html>
<header>
<style type="text/css">
div.father {
border: 1px solid black;
height: 364px;
width: 364px;
}
div.son {
border: 1px solid black;
height: 100px;
width: 100px;
padding-top:20px;
padding-left:20px;
}
</style>
</header>
<body>
<div class="father">
<div class="son">box1</div>
<div class="son">box2</div>
<div class="son">box3</div>
</div>
</body>
</html>
There is no blank between div.sons for the vertically displayed div.son.
Now let's make all div.sons horizontally displayed.
<html>
<header>
<style type="text/css">
div.father {
border: 1px solid black;
height: 364px;
width: 400px;
}
div.son {
margin:0px;
padding:0px;
border: 1px solid black;
height: 100px;
width: 100px;
padding-top:20px;
padding-left:20px;
display:inline-block;
}
</style>
</header>
<body>
<div class="father">
<div class="son">box1</div>
<div class="son">box2</div>
<div class="son">box3</div>
</div>
</body>
</html>
The displayed image is as the following.
How to remove all the blank between div.sons for the horizontally displayed image?
Solution :
One problem that arrises when you use inline-block
is that whitespace in HTML becomes visual space on screen.
There are a few ways to remove that space
Like this: https://jsfiddle.net/j6rcfkmz/
CSS Howto..
Have a look at this DEMO. Floating your divs left should solve this problem....
Based on comment above, I suggest you set min-height to 35px in your media query .navbar { min-height: 35px; } ...
Hey i think you should do this Define float properties in your socail icon and define margin padding width height according to your design Css .social{ float:right; border:solid 1px green;...
Try something like this: <html class="nojs"> <head> <script type="text/javascript"> document.getElementByTagName("html")[0].className=""; </script> <style> html#nojs { /* do something */ } </style> This removes a class while loading the page. If javascript...
Use the Z-index Property and assign to nav a higher z- index than others nav { position: fixed; left: 0px; top: 20%; height: 200px; width: 60px; background-color: #24933e; border-right:solid #176328;...
Increase the width of the button. <input type="submit" class="btn" /> CSS: .btn{ width:250px; /* adjust value */ } ...
I already wrote up the answer to this but it seems to have been deleted. The issue was that YUI added background-color:white to the html element. I over wrote that...
The code you posted is deprecated flexbox code. Here's a prefixed version, generated with last 10 versions with Autoprefixer on Play: flex-align: center; -webkit-box-orient: vertical; -webkit-box-direction: normal; -webkit-flex-direction: column; -ms-flex-direction:...
You can select which weight of font you want here: https://www.google.com/fonts#UsePlace:use/Collection:Source+Sans+Pro. If you want to download these files locally. Visit the href from the <link> Visit the url: from the...
These are based upon the Aside being 20% width and the Footer being 20% height. You can adjust accordingly. For the scrolling one, just remove the height attributes to allow...
You need to use display:block and float:left on the lis to remove the space. When they're inline the browser treats them as words, and so leaves space in between. Also...
Use left: auto !important; instead of left: none !important;
For that You can scan user Agent and find out which browser, its version. Including the OS for OS specific styles You can use various CSS Hacks for specific browser...
Actually, many ways. One of them: html <div class="wrapper"> <div class="line"></div> <div class="wordwrapper"> <div class="word">or</div> </div> </div> css .wrapper { position: relative; width: 250px; height: 300px; border: 1px dashed #ccc;...
Just found a nice trick: // /* Disabling ReSharper ;) // .less code goes here // */ It's better than disabling ReSharper for a particular set of files (ReSharper ->...
Gmail uses firefox file api, read more about it here https://developer.mozilla.org/en/Using_files_from_web_applications Or check this live demo http://robertnyman.com/html5/fileapi-upload/fileapi-upload.html Hope this will help/solve ur problem ;) best luck...
Remove position:fixed and add .background-pic [class^=number]{ display:block; clear:both } ...
Float the heading <h4>. * { margin: 0; padding: 0; } .inter > h4 { float: left; padding-right: .5em; } p { margin-bottom: 1em; } <div class="inter"> <h4>Note</h4> <p>To add/remove...
Use text-align: center on the parent... #q{ display: block; text-align: center; } .round { border-radius: 50%; display: inline; margin: 0 5px; width: 150px; height: 150px; } <div id="logos"> <div id="q">...
You could try any of the following, Vanilla window.onresize = function(event) { /** Your code here. **/ }; jQuery $(window).resize(function() { /** Your code here. **/ }); or A CSS...
Use this - var id = $(this).index('li'); Demo ---> http://jsfiddle.net/HjYZ6/6/...
The BorderContainerSkin is not expecting a URL for the background image. If you look at the skin, it uses a BitmapFill class for the background image. The skin takes whatever...
Would this be what you're trying to do ? .map-container iframe { position: absolute; top: 25%; left: 25%; width: 50%; height: 50%; } Or this ? (without absolute positioning) .map-container...
this might not be the best solution, but you could fix this with a little help of the css-pseudoclass nth-last-of-type(). I have modified your fiddle (the borders are just there...
By taking advantage of jQuery Ui's built in draggable event which gives us position information and also allows us to set position on drag. I came up with the following...
If, for example, your image is in the directory images/image.png, relative to the HTML file You would use <img src="images/image.png" />. This will work both online and locally....
If you are using a CSS preprocessor e.g. SASS/LESS you can simply define two color variables and use color mixing functions to generate the third color. SASS example: $color1: rgba(228,...
The problem is not with the precedence. I figured out that it should be vertical-align: middle instead of vertical-align: center This works....
I did a bit of rewriting to make this more Knockout-y and (hopefully) a bit more straightforward. I brought the header height into the code as a variable, since I...
A method that works on Chrome and IE, but not Firefox (version 31), is to use a pseudo-element added at the end of the first div and to specify a...