How to adjust navbar to a fixed width in Twitter Bootstrap?
Tags: css,twitter-bootstrap
Problem :
Default navbar spans horizontally across the browser window.
<div class="navbar navbar-static-top">
How do you declare the navbar to be only 750px
width and placed at the center?
Setting margin:auto;
in the CSS doesn't work.
Solution :
The .navbar-static-top
you are using forces your navbar to become full-width. Remove that class and you will get a resizable navbar. Then, you can wrap it in a span#
of the size you want:
<div class="container">
<div class="row">
<div class="span6 offset3">
<div class="navbar">
...
</div>
</div>
</div>
</div>
Here you have an example: http://jsfiddle.net/simbirsk/xAMYF/
CSS Howto..
Fixed your </li> tags in the code below and also replaced $("ol",this) with $(this).find("ol"). Seems to work: http://codepen.io/8odoros/pen/wzALyq <li><a href="#">About us</a> <ol> <li><a href="#">ประวัติ</a></li> <li><a...
Use jquery where you can select $(".nav a").eq(2).css("text-decoration","underline"). You won't be directly changing the css in the file. That isn't possible. But you can apply inline css to the element...
Here's what I put together from the info provided... works with the mousewheel, swiping and clicking on the top and bottom numbers. Infinite as requested of course. No special perspective...
You mean like this? #main .header { padding: 1em; height: 5%; background-color: #15e6c5; overflow: hidden; } #main .header .pull-right { margin-left: 10px; } And HTML <div class="header-buttons"> <button class="pure-button pure-button-primary...
Remove the 16px margin as follows: div#textright>p:first-child { margin-top: 0; } ...
The reason that you had to add a sleep is likely because of your animation. Many animations use setTimeout, which Angular (thus Protractor) does not know about and do not...
You can do it with css like this: .box , .appear{ background: #151515; height: 100px; width: 100px; float:left; } .appear{ background:red; display:none } .box:hover{ background: #e6e6e6; height: 100px; width: 100px;...
Is this what you're looking for? I don't fully understand but I'm thinking this might send you in the right direction... <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
why you dont use this? its also smarter ;) http://getbootstrap.com/components/#thumbnails-custom-content EDIT include code from bootstrap doc <div class="row"> <div class="col-sm-6 col-md-4"> <div class="thumbnail"> <img data-src="holder.js/300x200" alt="..."> <div class="caption">...
I would recommend using display: inline-block on the elements and then using text-align: center on the container to handle the centering you want: I cleaned up your HTML but here...
If you want to add a link to another website, then, you need to use the a href tag and since you want to add an image as a link,...
You can use margin around each icon, this way you can create the border and have the spacing around the icon. Here is a pen for you http://codepen.io/anon/pen/MKNdwj li {...
Use white-space: nowrap; for text to not break on white-spaces
I applied some transforms on the :after pseudo-element. Here's how: .ribbon { background: #04F; border-radius: 4px; position: relative; overflow: hidden; } .ribbon:after { content:' '; position: absolute; background: #0F4; width:...
One problem is that you've configured jsfiddle such that your JavaScript code is in a "load" handler, and you've set up your event handler in a way that makes that...
Id surely would not doing it with javascript or jQuery, because its all possible with CSS3 only here an example or check out the fiddle http://jsfiddle.net/mpaas/: #naviWrapper { -webkit-transition: all...
For a CSS only solution, without an nth-letter selector you're going to be dealing with workarounds. There is no nth-letter currently as you'll no doubt know, so here's a possible...
You may start with Titanium for desktop dev. Also you may have a look at Chromium Embedded Framework. It's basically a web browser control based on chromium. It's written in...
You should work with padding on the inner container rather than with margin. Try this! HTML <div class="row info-panel"> <div class="col-md-4" id="server_1"> <div class="server-action-menu"> Server 1 </div> </div> </div> CSS...
you can use Stylish, you can define global styles in firefox and ability to switch it on and off fast from Firefox. Usage page. Global styles, you can see code...
Try this, it's not the clean solution, but rather a workaround that could get the job done if you don't find a cleaner css solution.
There was/is an undocumented overlay option for overflow in webkit browsers. I don't suggest that you use until it's standardized. https://bugs.webkit.org/show_bug.cgi?id=32388...
The best solution I found for this problem was to use jQuery to assign e.preventDefault() to the click event of the link, thus disabling the background drag effect. Then, if...
For your case, I'd use something more like: application: website-example version: 1 runtime: python api_version: 1 default_expiration: "7d" handlers: - url: /css static_dir: css - url: /js static_dir: js -...
When using position: absolute, you need to make sure that it has a parent with a position attribute other than the default (which is static). If there is no such...
Insert this rule are the top of your .htaccess: RewriteRule ^(?!parent/)[^/]+/((?:CSS|JS)/.+)$ /parent/$1 [L,NC,R] ...
In Squarespace, currently, any ID starting with "yui" can/will change on page refresh. That is because such IDs are dynamically generated. Therefore, you should not rely on them for use...
Try this out fiddle. HTML <ul class="mainmenu"> <li><a href=#>Test1</a> <ul class="submenu"> <li><a href=#>Test1</a></li> <li><a href=#>Test2</a></li> <li><a href=#>Test3</a></li> </ul> </li>...
With jQuery, you are adding your styles to the style attribute of the element. It is removed again, if you call the function again with an empty string (""). This...
float .bot50x50 and .talkbubble both left and get rid of all the position: relative; styles unless absolutely needed. http://www.quirksmode.org/css/clearing.html...