CSS - want to remove a blank space but have no idea how to get rid of it?
Tags: html,html5,css3,css-float
Problem :
OK so here is my code, I don't understand why the first blank space is appearing to the left hand side of the page.
CSS
.header-left ol{
width: auto;
float: left;
display: block;
background-color: #6899D3;
}
.header-left li{
list-style:none;
float:left;
}
.header-left a {
color:#000;
display:block;
height: 50px;
text-align:center;
vertical-align:middle;
text-decoration:none;
min-width: 100px;
overflow: auto;
border-radius: 20px;
}
.header-left a:hover {
color:#000000;
text-decoration:none;
}
#nav1 a:hover { background-color: #FF5B0D; }
#nav2 a:hover { background-color:#00FF40;}
#nav3 a:hover { background-color:#FF0080;}
#nav4 a:hover { background-color:#00CCFF;}
#nav5 a:hover { background-color: #FFFF00; }
HTML
<div class="header-left">
<ol>
<li id="nav1"><a href="http://www.google.com">a</a></li>
<li id="nav2"><a href="http://www.google.com">b</a></li>
<li id="nav3"><a href="http://www.google.com">c</a></li>
<li id="nav4"><a href="http://www.google.com">d</a></li>
<li id="nav5"><a href="http://www.google.com">e</a></li>
</ol>
</div>
Solution :
You need to reset the natural padding
and margin
of the body
and ol
. Set:
body{
margin: 0;
padding: 0;
}
.header-left ol{
width: auto;
float: left;
display: block;
background-color: #6899D3;
margin: 0; //RESET DEFAULT
padding: 0; // RESET DEFAULT
}
CSS Howto..
JSFiddle is here. Note: The original content is here. HTML <p>Vestibulum mollis mauris <a href="#" class="tooltip" title="Sample tooltip">pellentesque</a></p> CSS .tooltip { display: inline; position: relative; } .tooltip:hover { color: #c00;...
It's a known bug in chrome. Styles don't get applied to options on the Mac.
Because the content inside the first ".columns" div are all absolutely positioned the div itself has no height. So what i've done is placed a transparent image as a placeholder...
Dusting off my high school geometry and my formidable graphics skills, I put this diagram together. If you have variables width, height, and rotation in javascript, you could express the...
define general css that used. Open "config.php" within directory CodeIgniter\system\application\config. $config['css'] = 'mystyles.css'; Create a file named mystyles.css within root application: \CodeIgniter. $this->load->helper('url'); $data['css'] = $this->config->item('css'); You can load css...
Use viewport height units: vh #main_image { max-width: 100%; max-height: 60vh; } ...
After hours of searching I found out the answer be adjusting the css. Now it's working perfectly with the code below: .ui-accordion-content { overflow:visible !important; } ...
Try using rowLines: False to remove row line styling For example: https://fiddle.sencha.com/#fiddle/11s7...
In your httpd.conf file, there will be an ErrorDocument section: # # Customizable error responses come in three flavors: # 1) plain text 2) local redirects 3) external redirects #...
Try this fiddle: http://jsfiddle.net/kDSqB/ It's not 100% accurate in working out full rotation, but I think that night be the fiddle environment. The code here: var $cog = $('#cog'), $body...
You can try defining some properties for the <param> element of the video embed: <param name="wmode" value="transparent"> That should make the video obey the z-index stacking of elements on the...
Apply overflow: hidden to the form. Move the margin on the inputs inside form to form itself. See: http://jsfiddle.net/eb2zR/1/...
Use something like this; <script> $(document).ready(function(){ //Code goes in here. }); </script> Don't forget to load the jQuery library at the same time from http://jquery.com/ Also, you are going to...
You can use the initial keyword to restore the default value of a CSS property. The initial CSS keyword applies the initial value of a property to an element. It...
OK so I found the answer. My CSS was referencing the wrong part. When the menu is changed to a custom menu using wp_nav_menu, CSS needs to reference the .menu_item_$n....
You can use something like this in your php page: <style type="text/css"> .your_class { <?php $colorValues = ... // get user's color settings from db echo ' color: ' ....
As @Andrew said, you need to need to nest your style statements in single quotes. And you must include your expression inside the brackets : <div class="image_wrap" th:style="${student.studentExamStatus ? 'border-style:...
OK, sorry if I'm doing a Stack Overflow faux pas, but I'm not sure how else to have it make sense that I now know the answer. Someone from Wordpress...
Sounds very much like you want to use the CSS attribute: Flexbox With flex box, you can define the max and min width and height and the max/min number of...
Guess you want a pure javascript solution now you havent included the tag jquery? <div id="N_fixedBottom">bla bla</div> script : document.onscroll = function() { if (window.innerHeight + window.scrollY > document.body.clientHeight) {...
Try this: If dropdown menu position is absolute change it to relative. Also if there Right css code change it to float:right. .menu-css{ position: relative; float:right; } ...
You need 4 pseudo elements to create this properly, because triangles are created using borders, so they can't have a border and different background-color. We therefore need an inner and...
We choose to version both the sass files, as well as the compiled css files. That way, everyone has access to the latest version of everything when they pull down...
jQuery selectors us the same syntax as CSS does, so you can just use the :enabled pseudo-class selector: if ($('#sectionA:enabled')) { ... } But, after reading your comments, I'm not...
Use .addClass() and .removeClass() jQuery functions: $(document).ready(function() { var cur_stus; //close all on default $('#accordion dd').hide(); $('#accordion dt').attr('stus', ''); //open default data $('#accordion dd:eq(0)').slideDown(); $('#accordion dt:eq(0)').attr('stus', 'active'); $('#accordion...
There is no way to force the browser to maximum height. You can write css like .max_width{ width: 100%; } this will make the container 100%. But the height will...
Backend At first you need to define a database with a table for your houses with the properties you want to store. To store the houses position you need a...
Added margin-right:-5px; to .slide class: http://jsfiddle.net/Mutant_Tractor/BcQbk/4/ Aside from that if it is tabular data by all means use tables, that is what they are for, They become evil when you...
As explained in comments, the for loop is too quick to notice the effect, Instead you may use interval, set the interval period to 40 this is like 25 frames...
Use following CSS will help to solve your issue: Give image url to section after or before. and give opacity with that. So, it will not effect to text. section...