On my website, I was previously displaying 4 plan cards. I'm looking on displaying only 3 cards, so I commented one of them. As result, they are not centered. How can I center them?
Here's how it's being currently displayed:
Here's the code:
<!-- Row fuid-->
<div class="row">
<!-- Item table -->
<div class="col-sm-6 col-md-4 col-lg-3">
<div class="item_table">
<div class="head_table">
<h1>FREE</h1>
<h2>£ 0.00 <span>/ Mo</span></h2>
</div>
<ul>
<li class="color">2 GB HDD</li>
<li>25GB Bandwidth</li>
<li class="color">1 E-mail Account</li>
<li>1 Sub Domains</li>
<li class="color">cPanel/Site Creator</li>
<li>1 FTP Account</li>
<li class="color">1 Cron Job</li>
<li>1 Addon Domain</li>
<li class="color">1 Parked Domain</li>
</ul>
Order Now
</div>
</div>
<!-- End Item table -->
<!-- Item table -->
<div class="col-sm-6 col-md-4 col-lg-3">
<div class="item_table">
<div class="head_table">
<h1>PREMIUM</h1>
<h2>£ 0.99 <span>/ Mo</span></h2>
</div>
<ul>
<li class="color">30 GB HDD</li>
<li>1000GB Bandwidth</li>
<li class="color">1024MB RAM</li>
<li>2 Dedicated IP Addresses</li>
<li class="color">cPanel/WHM Included</li>
<li>Open VZ Included</li>
</ul>
Order Now
</div>
</div>
<!-- End Item table -->
<!-- Item table -->
<!--<div class="col-sm-6 col-md-4 col-lg-3">
<div class="item_table">
<div class="head_table">
<h1>V.I.P</h1>
<h2>£ 2.00 <span>/ Mo</span></h2>
<!--<h5>Or $ 150.5 Yearly!</h5>
</div>
<ul>
<li class="color">30 GB HDD</li>
<li>1000GB Bandwidth</li>
<li class="color">1024MB RAM</li>
<li>2 Dedicated IP Addresses</li>
<li class="color">cPanel/WHM Included</li>
<li>Open VZ Included</li>
</ul>
Order Now
</div>
</div>-->
<!-- End Item table -->
You can still use <div align="center">stuff here</div> and it will work fine just if you want the containing items to not center content on them say <tag style="text-align:left;">...</tag>
Another way is to inside your CSS file have the following code:
* { margin:0px auto; }
div.container { width:1000px; border:1px solid black; }
The * applies to the entire page and sets up the page to be centered.
You then need some other tag like div with a set width to take advantage of the property.
In your HTML file:
<div class="container">...</div>
I think there's two answers...
CSS has text-align: center and with Bootstrap's 12 column layout, you need to give each column 4 each I used the col-sm-4 since JSFiddle's window is small.
Here's my example:
http://jsfiddle.net/N7mvN/ make sure to pull the display window open wider to see it
Here's the HTML:
<!-- Row fuid-->
<div>
<div class="row" style="margin:0 auto">
<!-- Item table -->
<div class="col-sm-4">
<div class="item_table" style="background-color:red">
<div class="head_table">
<h1>FREE</h1>
<h2>£ 0.00 <span>/ Mo</span></h2>
</div>
<ul>
<li class="color">2 GB HDD</li>
<li>25GB Bandwidth</li>
<li class="color">1 E-mail Account</li>
<li>1 Sub Domains</li>
<li class="color">cPanel/Site Creator</li>
<li>1 FTP Account</li>
<li class="color">1 Cron Job</li>
<li>1 Addon Domain</li>
<li class="color">1 Parked Domain</li>
</ul>
Order Now
</div>
</div>
<!-- End Item table -->
<!-- Item table -->
<div class="col-sm-4">
<div class="item_table" style="background-color:green">
<div class="head_table">
<h1>PREMIUM</h1>
<h2>£ 0.99 <span>/ Mo</span></h2>
</div>
<ul>
<li class="color">30 GB HDD</li>
<li>1000GB Bandwidth</li>
<li class="color">1024MB RAM</li>
<li>2 Dedicated IP Addresses</li>
<li class="color">cPanel/WHM Included</li>
<li>Open VZ Included</li>
</ul>
Order Now
</div>
</div>
<!-- End Item table -->
<!-- Item table -->
<div class="col-sm-4">
<div class="item_table" style="background-color:blue">
<div class="head_table">
<h1>V.I.P</h1>
<h2>£ 2.00 <span>/ Mo</span></h2>
<h5>Or $ 150.5 Yearly!</h5>
</div>
<ul>
<li class="color">30 GB HDD</li>
<li>1000GB Bandwidth</li>
<li class="color">1024MB RAM</li>
<li>2 Dedicated IP Addresses</li>
<li class="color">cPanel/WHM Included</li>
<li>Open VZ Included</li>
</ul>
Order Now
</div>
</div>
<!-- End Item table -->
</div>
</div>
And some extra CSS:
.item_table {
margin:1.5em;
padding:1em;
text-align:center;
}
Wrap them all in a div with the style attribute set to margin: 0px auto; width: 1000px; where 1000px is the width of the contained elements. ie. will need to be changed considering I don't know the widths of your elements.
html:
<div class="container">
<div class="third inline"><!-- content --></div>
<div class="third inline"><!-- content --></div>
<div class="third inline"><!-- content --></div>
</div>
css
.third{
width:30%;
margin:0;}
.inline{
display:inline-block;}
.container{
width:50%;/*whatever*/
margin:0 auto;}
Related
I have a footer I am working on called <footer class="site-footer">, inside this footer there is a container <div class="container"> and inside this container, 3 divisions. col-sm-12 col-md-6 and col-xs-6 col-md-3 (2 of col-xs-6 col-md-3).
What I am doing here is making these 3 divisions on the same block. but with spacing.
I used :
.row{
display: flex;
}
row class is the class that contains these 3 divisions.
The picture below shows what I am asking, I need to make distance between the About, Hot Offers and Links sections. On the other hand the social profiles below should be on the right.
The full code of the footer is:
.row {
display: flex;
}
<!-- Bootstrap 4.1.3 -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<!-- Site footer -->
<footer class="site-footer">
<div class="container">
<div class="row">
<div class="col-sm-12 col-md-6">
<h6>About</h6>
<p class="text-justify">Paragraph about us.</p>
</div>
<div class="col-xs-6 col-md-3">
<h6>Hot Offers</h6>
<ul class="footer-links">
<li> Offer 1 </li>
<li> Offer 2 </li>
<li> Offer 3 </li>
</ul>
</div>
<div class="col-xs-6 col-md-3">
<h6>Quick Links</h6>
<ul class="footer-links">
<li>About Us</li>
<li>Contact Us</li>
<li>Refund Policy</li>
<li>Sitemap</li>
</ul>
</div>
</div>
<hr>
</div>
<div class="container">
<div class="row">
<div class="col-md-8 col-sm-6 col-xs-12">
<p class="copyright-text">Copyright © 2021 All Rights Reserved by
-.
</p>
</div>
<div class="col-md-4 col-sm-6 col-xs-12">
<ul class="social-icons">
<li><a class="facebook" href="#"><i class="fa fa-facebook"></i></a></li>
<li><a class="twitter" href="#"><i class="fa fa-twitter"></i></a></li>
<li><a class="linkedin" href="#"><i class="fa fa-linkedin"></i></a></li>
</ul>
</div>
</div>
</div>
</footer>
If you want to add space between your blocks you can add padding on your element (your 4 columns).
With Bootstrap you can add (for example) the class "px-2" to each of your column. Like :
<div class="col-xs-12 col-md-3 px-2">
This will add 0.5 inner space on right and left of your column.
Using spacing with Bootstrap : https://getbootstrap.com/docs/4.0/utilities/spacing/
If you don't use Bootstrap, just add padding style property to your element, like :
.column{
padding: 0 0.5rem // will add margin on right and left
}
Also, if you want to add your social profils on the same row, on the right, you have to put you DIV element on the same DIV with class "row", like below.
With the class "col-md-3" on each DIV, the columns will be displayed on the same row from medium screens to extra large screen.
Bootstrap grid system : https://getbootstrap.com/docs/4.0/layout/grid/
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet"/>
<!-- Site footer -->
<footer class="site-footer">
<div class="container">
<!-- One row with the 4 columns -->
<div class="row">
<div class="col-xs-12 col-md-3 px-2">
<!-- "About" content -->
<h6>About</h6>
<p class="text-justify">Paragraph about us.</p>
</div>
<div class="col-xs-6 col-md-3 px-2">
<!-- "Hot Offers" content -->
<h6>Hot Offers</h6>
<ul class="footer-links">
<li> Offer 1 </li>
<li> Offer 2 </li>
<li> Offer 3 </li>
</ul>
</div>
<div class="col-xs-6 col-md-3 px-2">
<h6>Quick Links</h6>
<ul class="footer-links">
<li>About Us</li>
<li>Contact Us</li>
<li>Refund Policy</li>
<li>Sitemap</li>
</ul>
</div>
<div class="col-xs-6 col-md-3 px-2">
<h6>Social profiles</h6>
<ul class="social-icons">
<li><a class="facebook" href="#"><i class="fa fa-facebook"></i>FB</a></li>
<li><a class="twitter" href="#"><i class="fa fa-twitter"></i>Twitter</a></li>
<li><a class="linkedin" href="#"><i class="fa fa-linkedin"></i>LinkedIn</a></li>
</ul>
</div>
</div>
<hr>
<div class="row">
<div class="col-md-8 col-sm-6 col-xs-12">
<p class="copyright-text">Copyright © 2021 All Rights Reserved by
-.
</p>
</div>
</div>
</div>
</footer>
Finally, about your comment on your answer "if I use bootstrap everything works out but some of the text went bold, etc", you can only import bootstrap-grid.css or bootstrap-grid.min.css.
It only includes grid system and flex utilities without all styles on elements.
I am trying to create a two-columns layout. Main content column contains the blog card and the second column which I'm trying to place at the top right corner contains.
This is the blog card.
The Bootstrap layout I'm using:
<main role="main" class="container">
<div class="row">
<div class="col-md-8">
<div class="blog-card">
<div class="meta">
<div class="photo" style="background-image: url({{ post.featured_image }})"></div>
<ul class="details">
<li class="author">John Doe</li>
<li class="date">Aug. 24, 2015</li>
<li class="tags">
<ul>
<li>Learn</li>
<li>Code</li>
<li>HTML</li>
<li>CSS</li>
</ul>
</li>
</ul>
</div>
<div class="description">
<h1>{{post.title}}</h1>
<h2>Opening a door to the future</h2>
<p>{{post.summary}}</p>
<p class="read-more">
Read More
</p>
</div>
</div>
</div>
{% endfor %}
<div class="col-md-4">
<div class="content-section">
<h3>Our Sidebar</h3>
<p class='text-muted'>
You can put any information here you'd like.
<ul class="list-group">
<li class="list-group-item list-group-item-light">Latest Posts</li>
<li class="list-group-item list-group-item-light">Announcements</li>
<li class="list-group-item list-group-item-light">Calendars</li>
<li class="list-group-item list-group-item-light">etc</li>
</ul>
</p>
</div>
</div>
</div>
</main>
The col-md-4 content doesn't stick to the right on desktop view, it just appears at the bottom of the card. I've tried several methods but it doesn't work. I'm actually calling an API and using the blog card to display posts from the CMS I am using. Instead of the sidebar to remain at the top right with the first post it sticks to the last post.
You use container class in main tag. This class has max-width and padding from left and right. If you want use 100% of the page use container-fluid class.
<main role="main" class="container-fluid">
<div class="row">
<div class="col-md-8" style="border:solid 1px red">
{% blog %}{% card html }
</div>
<div class="col-md-4" style="border:solid 1px red">
<div class="content-section">
<h3>Our Sidebar</h3>
<p class='text-muted'>
You can put any information here you'd like.
<ul class="list-group">
<li class="list-group-item list-group-item-light">Latest Posts</li>
<li class="list-group-item list-group-item-light">Announcements</li>
<li class="list-group-item list-group-item-light">Calendars</li>
<li class="list-group-item list-group-item-light">etc</li>
</ul>
</p>
</div>
</div>
</div>
</main>`
I eventually got it to work: I made the sidebar show only on certain screen sizes. Although, my blog card gets scattered, I am okay with the outcome.
Instead of using columns, media queries did the trick:
#media only screen and (min-width: 1020px) and (max-width: 3000px)
I can't seem to figure out why the carousel indicators are not clickable like on the Boostrap 4 carousel examples I have seen. From what I have seen this functionality should work without any extra code but mine doesn't. I can't see what I've done wrong as all I did was copy the carousel from the Boostrap documents, and then add some content. I would like to have clickable text as the indicators for each slide. What have I done wrong?
.carousel-indicators {
background-color: blue;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<section class="drinks_menu">
<div class="container">
<div id="drinks_carousel" class="slide" data-ride="carousel">
<ul class="carousel-indicators">
<li data-target="#drinks_carousel" data-slide-to="0" class="active">HOT DRINKS</li>
<li data-target="#drinks_carousel" data-slide-to="1">SOFT DRINKS</li>
<li data-target="#drinks_carousel" data-slide-to="2">BEER</li>
<li data-target="#drinks_carousel" data-slide-to="3">WINE</li>
<li data-target="#drinks_carousel" data-slide-to="4">SPIRITS</li>
</ul>
<div class="carousel-inner">
<div class="carousel-item active">
<div class="row">
<div class="col-12">
<h2 class="heading">HOT DRINKS</h2>
</div>
</div>
<div class="row">
<ul class="menu_list">
<li>Espresso <span>£1.80</span></li>
<li>Espresso macchiato <span>£1.90</span></li>
<li>Tea - peppermint / green / camomile / earl grey / yorkshire <span>£1.90</span></li>
<li>Americano <span>£2.00</span></li>
<li>Caffe latte <span>£2.40</span></li>
</ul>
<ul class="menu_list">
<li>Flat white <span>£2.60</span></li>
<li>Cappucino <span>£2.40</span></li>
<li>Mocha <span>£2.60</span></li>
<li>Hot chocolate <span>£2.40</span></li>
</ul>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-12">
<h2 class="heading">SOFT DRINKS</h2>
</div>
</div>
<div class="row">
<ul class="menu_list">
<li>San pellegrino cans – blood orange / limonata/ orange pomegranate<span>£1.80</span></li>
<li>Harrogate spring still water <span>£1.40</span></li>
<li>Smeraldina sparkling water<span>£2.00</span></li>
</ul>
<ul class="menu_list">
<li>Fresh juice – orange / apple <span>£1.80</span></li>
<li>Coca cola / sprite <span>£1.50</span></li>
</ul>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-12">
<h2 class="heading">BEER</h2>
</div>
</div>
<div class="row">
<ul class="menu_list full">
<li>Draught – birra moretti <span>½ pint £2.20</span>span> <span>Pint £4.40</span></li>
<li>Speciality birra moretti<span>toscana £4.80</span> <span>siciliana £4.80</span></li>
</ul>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-12">
<h2 class="heading">WINE</h2>
</div>
</div>
<div class="row">
<ul class="menu_list">
<li class="section_title">House</li>
<li>Tenuta san marco white / red<span>125ML £2.75</span> <span>250ML £5.50</span> <span>500ML carafe £11.00</span></li>
<li class="section_title">Red</li>
<li>Malbec- El Finatello; Chile <span>250ML £6.50</span> <span>Bottle £19.50</span></li>
<li>Chianti D.O.C. - Vernaiolo; Italy <span>250ML £7.00</span> <span>Bottle £21.00</span></li>
</ul>
<ul class="menu_list">
<li class="section_title">White</li>
<li>Gavi Di Gavi – conti speroni; Italy <span>250ML £7.00</span> <span>Bottle £21.00</span></li>
<li>Sauvignon Blanc- Clifford Quay; New Zealand <span>250ML £7.50</span> <span>Bottle £22.00</span></li>
<li class="section_title">Rose</li>
<li>Pinot Grigio Rose – Villa Serena; Italy <span>250ML £6.50</span> <span>Bottle £19.50</span> </li>
</ul>
<ul class="menu_list">
<li class="section_title">Prosecco</li>
<li>Miol D.O.C. Treviso – Italy <span>125ML £6.00</span> <span>Bottle £24.00</span></li>
</ul>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-12">
<h2 class="heading">SPIRITS</h2>
</div>
</div>
<div class="row">
<ul class="menu_list">
<li>Aperol Spritz <span>£6.90</span></li>
<li>Grappa Invecchiata<span>£3.50</span></li>
</ul>
<ul class="menu_list">
<li>Limoncello <span>£3.50</span></li>
<li>Malfy Gin & Fever Tree Tonic – Sicilian bloody orange / Sicilian pink grapefruit / Limone / Originale <span>£6.50</span></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
What you are missing is this <div id="drinks_carousel" class="carousel slide" data-ride="carousel">
the carousel class is missing from the div. check this out.
.carousel-indicators {
background-color: blue;
}
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/js/bootstrap.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.3/umd/popper.min.js"></script>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" rel="stylesheet" />
<section class="drinks_menu">
<div class="container">
<div id="drinks_carousel" class="carousel slide" data-ride="carousel">
<ul class="carousel-indicators">
<li data-target="#drinks_carousel" data-slide-to="0" class="active">HOT DRINKS</li>
<li data-target="#drinks_carousel" data-slide-to="1">SOFT DRINKS</li>
<li data-target="#drinks_carousel" data-slide-to="2">BEER</li>
<li data-target="#drinks_carousel" data-slide-to="3">WINE</li>
<li data-target="#drinks_carousel" data-slide-to="4">SPIRITS</li>
</ul>
<div class="carousel-inner">
<div class="carousel-item active">
<div class="row">
<div class="col-12">
<h2 class="heading">HOT DRINKS</h2>
</div>
</div>
<div class="row">
<ul class="menu_list">
<li>Espresso <span>£1.80</span></li>
<li>Espresso macchiato <span>£1.90</span></li>
<li>Tea - peppermint / green / camomile / earl grey / yorkshire <span>£1.90</span></li>
<li>Americano <span>£2.00</span></li>
<li>Caffe latte <span>£2.40</span></li>
</ul>
<ul class="menu_list">
<li>Flat white <span>£2.60</span></li>
<li>Cappucino <span>£2.40</span></li>
<li>Mocha <span>£2.60</span></li>
<li>Hot chocolate <span>£2.40</span></li>
</ul>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-12">
<h2 class="heading">SOFT DRINKS</h2>
</div>
</div>
<div class="row">
<ul class="menu_list">
<li>San pellegrino cans – blood orange / limonata/ orange pomegranate<span>£1.80</span></li>
<li>Harrogate spring still water <span>£1.40</span></li>
<li>Smeraldina sparkling water<span>£2.00</span></li>
</ul>
<ul class="menu_list">
<li>Fresh juice – orange / apple <span>£1.80</span></li>
<li>Coca cola / sprite <span>£1.50</span></li>
</ul>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-12">
<h2 class="heading">BEER</h2>
</div>
</div>
<div class="row">
<ul class="menu_list full">
<li>Draught – birra moretti <span>½ pint £2.20</span>span> <span>Pint £4.40</span></li>
<li>Speciality birra moretti<span>toscana £4.80</span> <span>siciliana £4.80</span></li>
</ul>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-12">
<h2 class="heading">WINE</h2>
</div>
</div>
<div class="row">
<ul class="menu_list">
<li class="section_title">House</li>
<li>Tenuta san marco white / red<span>125ML £2.75</span> <span>250ML £5.50</span> <span>500ML carafe £11.00</span></li>
<li class="section_title">Red</li>
<li>Malbec- El Finatello; Chile <span>250ML £6.50</span> <span>Bottle £19.50</span></li>
<li>Chianti D.O.C. - Vernaiolo; Italy <span>250ML £7.00</span> <span>Bottle £21.00</span></li>
</ul>
<ul class="menu_list">
<li class="section_title">White</li>
<li>Gavi Di Gavi – conti speroni; Italy <span>250ML £7.00</span> <span>Bottle £21.00</span></li>
<li>Sauvignon Blanc- Clifford Quay; New Zealand <span>250ML £7.50</span> <span>Bottle £22.00</span></li>
<li class="section_title">Rose</li>
<li>Pinot Grigio Rose – Villa Serena; Italy <span>250ML £6.50</span> <span>Bottle £19.50</span> </li>
</ul>
<ul class="menu_list">
<li class="section_title">Prosecco</li>
<li>Miol D.O.C. Treviso – Italy <span>125ML £6.00</span> <span>Bottle £24.00</span></li>
</ul>
</div>
</div>
<div class="carousel-item">
<div class="row">
<div class="col-12">
<h2 class="heading">SPIRITS</h2>
</div>
</div>
<div class="row">
<ul class="menu_list">
<li>Aperol Spritz <span>£6.90</span></li>
<li>Grappa Invecchiata<span>£3.50</span></li>
</ul>
<ul class="menu_list">
<li>Limoncello <span>£3.50</span></li>
<li>Malfy Gin & Fever Tree Tonic – Sicilian bloody orange / Sicilian pink grapefruit / Limone / Originale <span>£6.50</span></li>
</ul>
</div>
</div>
</div>
</div>
</div>
</section>
i can't find a way to make that work.
i have a sidebar which i pull to the right on desktop side.
i don't know on what row to put the pink div.
This is what i wrote but i don't think it's good.. http://jsfiddle.net/o7vmx2to/
<div class="row">
<article class="col-xs-24 col-sm-18 pull-right">
<div>Left div</div>
</article>
<aside class="col-xs-24 col-sm-6 pull-left">
<div class="row">
<div class="col-xs-24">
<ul class="list-unstyled button_list">
<li>button a</li>
<li>button b</li>
<li>button c</li>
<li>button d</li>
<li>button e</li>
<li>button f</li>
</ul>
</div>
</div>
<div class="row">
<div>This one need to be moved</div>
</div>
</aside>
You need to wrap your stuff in a <div class="container"> which automatically resizes when you change from xs to sm,md and lg
Bootstrap grid system is based on 12 columns not 24. So divide everything by 2
JSFiddle : http://jsfiddle.net/snatgu5f/
Actually it would be a lot easier if you swapped the blue and green divs in the left picture. Because then you end up with a standard bootstrap layout without the need for .pull-right class. I suspect you might actually want this. The code would need to be like this :
<div class="container"><div class="row">
<div class="col-xs-12 col-sm-3">
<nav><ul class="nav nav-stacked nav-pills">
<li class="diabled">Menu</li>
<li>Something</li>
</ul></nav>
</div>
<div class="col-xs-12 col-sm-9">
<article class="row">
Some Text
</article>
<article class="row">
Some more text
</article>
</div>
</div></div>
Yet if you really need the blocks to be positionned like in your picture, here's what you could do (the trick is ton only have one row and either to make the left-menu "pull-left" or the other blocks "pull-right"
<div class="container">
<div class="row">
<article class="col-xs-12 col-sm-9 pull-right">
Green Block </article>
<nav class="col-xs-12 col-sm-3">
<ul class="list-unstyled button_list">
<li>button a</li>
<li>button b</li>
<li>button c</li>
<li>button d</li>
<li>button e</li>
<li>button f</li>
</ul>
</nav>
<article class="col-xs-12 col-sm-9 pull-right">
Purple block</article>
</div>
I'm stuck with the CSS of following HTML link and want to expand the height of header image so I can adjust larger with it, but when I play with the CSS of the .header & .logo classes it expands the navigation bar also, I just really need to expand the height of the header image to have larger height logo into it.
Looking your html source seems you can have different solutions. Problem is with your html... You have
<div class="navigation">
inside
<div class="container">
Ans : get navigation div out of container div. Then changing the height of container div would be the best and not affect the height of your links.
Why you are getting problem : your header div is containing links inside it. That is why changing the height of header is not good (It simply changes the overall height of this div).
Update : Reply to your first comment on my answer
<div class="inner">
<div class="container">
<!-- Logo Start -->
<div class="five columns left">
<img src="images/logo.png" alt="" />
</div>
<!-- Logo End -->
<div class="eleven columns right">
<!-- Top Links Start -->
<ul class="top-links">
<li>
<h4 class="colr">Search Music</h4>
<div id="search-box">
<input name="" value="Enter any keyword"
onfocus="if(this.value=='Enter any keyword') {this.value='';}"
onblur="if(this.value=='') {this.value='Enter any keyword';}" type="text" class="bar" />
<button>Search</button>
</div>
</li>
<li>
LOG IN
<div id="login-box">
<h4 class="white backcolr">User Login </h4>
<ul>
<li>
<input name="" value="yourname#email.com"
onfocus="if(this.value=='yourname#email.com') {this.value='';}"
onblur="if(this.value=='') {this.value='yourname#email.com';}" type="text" class="bar" />
</li>
<li>
<input name="" value="password"
onfocus="if(this.value=='password') {this.value='';}"
onblur="if(this.value=='') {this.value='password';}" type="password" class="bar" />
</li>
<li>
<input type="checkbox" class="left" />
<p>Remember me</p>
Forget Password?
</li>
<li>
<button class="backcolrhover">Login</button>
</li>
</ul>
<div class="clear"></div>
</div>
</li>
</ul>
<!-- Top Links End -->
</div>
<div class="clear"></div>
</div>
<!-- Container End -->
<!-- Navigation Start -->
<div class="navigation">
<div id="smoothmenu1" class="ddsmoothmenu">
<ul id="nav">
<li class="current-menu-item">Home</li>
<li>NEWS</li>
<li>Albums
<ul>
<li>Albums</li>
<li>Album Detail</li>
</ul>
</li>
<li>Blog
<ul>
<li>Blog</li>
<li>Blog Detail</li>
</ul>
</li>
<li>Gallery
<ul>
<li>Gallery - Two Column</li>
<li>Gallery - Three Column</li>
<li>Gallery - Four Column</li>
<li>Gallery - Slide Show</li>
</ul>
</li>
<li>About Us</li>
<li>Contact Us</li>
<li>BUY THIS THEME</li>
</ul>
<div class="clear"></div>
</div>
</div>
<!-- Navigation End -->
</div>
Then change your css and see the results
.container {
width:100%;
height:100px; /* I have changed it 50px to 100px*/
float:left;
margin-top:2px;
}
Change your header height here :
#header {
width:100%;
height:148px; <-----------Here
float:left;
position:relative;
z-index:2;
margin-bottom:15px;
box-shadow:0px 2px 2px #000;
background:url(../images/header.gif) repeat-x;
}
Edit: I just inspected with firebug, you are using multiple classes and you've nested div's, your logo div lies here
five columns left
I guess you've picked this template and you are trying to edit it right?