How to force the horizontal scroll bar to appear?
Tags: html,css,scrollbar
Problem :
Consider the following code:
HTML:
<div id="wrapper">
<div class='a'></div>
<div class='a'></div>
<div class='a'></div>
<div class='a'></div>
<div class='a'></div>
</div>
CSS:
#wrapper {
width: 300px;
border: 1px solid black;
overflow: auto;
}
.a {
width: 70px;
height: 70px;
border: 1px solid red;
float: left;
}
How could I force the horizontal scroll bar to appear rather than displaying the red div's in the second line ?
Solution :
Try this:
#wrapper {
width: 300px;
border: 1px solid black;
overflow: auto;
white-space: nowrap;
}
.a {
width: 70px;
height: 70px;
border: 1px solid red;
display: inline-block;
}
It will give you spacing between the inner divs - put them all in one line to remove those.
CSS Howto..
the structure you have is sass/scss/less. In css, you do it like so:- .parent-class .pagination { font-size: 10px } .parent-class a { font-size: 30px } ............... Once sass/scss/less is compiled,...
Is this what you are looking for? I gave the popup a parent container that will serve as the overlay. HTML: <div class="overlay"> <div id="welcome"> <span id="close"></span> This is the...
You can add an element to a selector via jQuery's .add() method: $(this).add('#element2').css('background-color', '#dcf0ff') ...
the line-height of the .gcse-container is 0px. Set it to 20px or remove the rule will solve your problem.
div:nth-of-type(4n) > div > div:first-child { background-color: yellow; } Fiddle 1: http://jsfiddle.net/abhitalks/6Laay9s6/ This will work even if your entire structure is nested in a wrapper(s), and/or there are elements before...
Add z-index for this nav icon. Update your CSS like below. #nav { position:absolute; left: 49%; top: 89%; z-index:2; } ...
Thanks to @orangeh0g 's answer, I checked the css generated by autoprefixer in my codepen code. I find that I only need to add -ms-flex-positive: 1; to the text css...
Or for any version of IE, try FireBug Lite. You can simply bookmark the link given on that page (bookmarklet) and then, to open a FireBug like thingy whilst on...
Try this: sed -i.bak '/^stage/,/}$/ s/font-size:.*/font-size: 20pt;/g' theme.css It will do the replacement between the lines which begin with 'stage' and ends with '}' Let me know how it goes....
Insert this rule are the top of your .htaccess: RewriteRule ^(?!parent/)[^/]+/((?:CSS|JS)/.+)$ /parent/$1 [L,NC,R] ...
One problem with the accepted answer is that the browser will have to load the content of all the tabs on page load. This may not be very good if...
Okay, let's start with jQuery, since it's more concise. $('form').each(function () { $(this).find('input').filter(':text').each(function () { $(this).after($('<button>').text('My Button')); }); }); http://jsfiddle.net/xERT8/2/ Edited for non-jquery version. Okay, here we go! var forms...
Alright, this is what I've got, based on Duopixel's use of before and after filters but with the borders actually living on the before and after blocks so that I...
Yes, you can animate with pure CSS using the animate property. For example, if you would want #img1 to show first, and #img2 to show after, you can set an...
What you have is trying to match .red:hover that is inside .button:hover, which implies a nested element in your markup. Since you're selecting the same element, you need to combine...
if every column is an ul > li you may assign different line-height both to ul and li. Or just assign a line-height to each li and make some space...
You may use other unicode or use borders : DEMO .select:before{ content: "\25be or \25bc ? "; float:right; color:gray; } .select:after{ content: ""; margin:0 0.5em; display:inline-block; border: 7px solid transparent;...
Referring to the Is there a CSS parent selector? topic, there is no parent selector in CSS. Leave the "getting the parent" part to the XPath: WebElement we = dr.findElement(By.cssSelector("div[id='gf-BIG']"));...
I ended up using conditional comments in my javascript file. This way I could address IE6 and apply the CSS class $(function(){ //add css class to input[type=text] fields if the...
Edit: Cleaned css from @drew-kennedy https://jsfiddle.net/tn8b82u9/14/ Try this: HTML: <div class="main_container"> <div class="row top-logos"> <div class="col-lg-12 clear"> <div id="logo_1"> <img...
This works. .views-slideshow-controls-bottom{ position: relative; top: -35px; left: 50px; z-index: 999; } ...
Use $(window).load instead of $(document).ready - the difference is that the latter will run after all your assets are loaded including images.
Maybe something like this helps? http://jsfiddle.net/epyFT/3/ I'm not sure how to make the button align to the no-wrapped width of the container, and am only using percentage widths for the...
LESS is a CSS language that compiles to normal CSS and gives you the ability to abstract away a lot of the tedious elements of writing stylesheets such as typing...
#picture { background-image:url('no-bullying.jpg'); height:100px; width:50px; position: absolute; bottom:10px; left:10px; } ...
Try this: http://jsfiddle.net/r83FD/1/ .parent_menu div { height: 0; overflow: hidden; } .parent_menu:hover div { height: auto; } ...
Using a container around 1 and 2 you can do it, like this: * { box-sizing: border-box; } .wrapper { display: flex; flex-direction: row; } .container { flex-direction: column; flex-grow:...
tables are one of the solutions to make page grow horizontally so when your using divs use these classes to simulate table behavior: #background { background-color:#9B59B6; margin: -19px 0 0...
Maybe you are after some of these methods: Method 1 body { margin: 0; background-color:#F8F8F8; } #header { background-color:#FFFFFF; height: 70px; } <body> <div id="header"> <h1>Welcome</h1> </div> <div> <h2>About Us</h2>...
This should help answer your questions: http://www.sitepoint.com/is-generated-content-actually-content/ Based on the authors indication that: Generated content is not content at all, it’s presentation. I would assume that since the content generated...