Search icon
Subscription
0
Cart icon
Close icon
You have no products in your basket yet
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Bootstrap Site Blueprints Volume II

You're reading from  Bootstrap Site Blueprints Volume II

Product type Book
Published in Jan 2016
Publisher Packt
ISBN-13 9781785281099
Pages 328 pages
Edition 1st Edition
Languages
Author (1):
Matt Lambert Matt Lambert
Profile icon Matt Lambert

Mobile-specific styling


The last thing I'll cover in this chapter is some specific mobile styles that I applied to the layout. You will need to insert these styles at the bottom of theme.less in the /css directory. Before I explain the code, here's a preview of what the mobile version will look like on a phone:

Now, let's review the custom styles that go into the making of this layout:

@media (max-width: 768px) {
  .container {
    padding-right: @padding;
    padding-left: @padding;
  }

  .add-content {
    float: left;
    margin-top: @margin;
  }

  li.desktop-only {
    display: none;
  }

  .modal a {
    font-size: (@font-size * 2);
  }
}

Let me explain how the mobile specific styles work for this project:

  • I'm using the value of 768px in the media query to target tablets and phones with these mobile-specific styles.

  • The styles in the .container class reset the left and right padding. I've added more padding to our desktop containers to squeeze the layout.

  • I want the Add Content button to...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €14.99/month. Cancel anytime}