Bootstrap - How to move styles in HTML to the .css from the example


Tags: html,css,twitter-bootstrap

Problem :

The example I am currently trying to reproduce.

Within the of the carosel.html I can only presume that it has added/edited the styles which are needed to make the correct layout.

<head>
<meta charset="utf-8">
<title>Carousel Template &middot; Bootstrap</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">

<!-- Le styles -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<style>

/* GLOBAL STYLES
-------------------------------------------------- */
/* Padding below the footer and lighter body text */

body {
  padding-bottom: 40px;
  color: #5a5a5a;
}



/* CUSTOMIZE THE NAVBAR
-------------------------------------------------- */

/* Special class on .container surrounding .navbar, used for positioning it into place. */
.navbar-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 10;
  margin-top: 20px;
  margin-bottom: -90px; /* Negative margin to pull up carousel. 90px is roughly margins and height of navbar. */
}
.navbar-wrapper .navbar {

}

/* Remove border and change up box shadow for more contrast */
.navbar .navbar-inner {
  border: 0;
  -webkit-box-shadow: 0 2px 10px rgba(0,0,0,.25);
     -moz-box-shadow: 0 2px 10px rgba(0,0,0,.25);
          box-shadow: 0 2px 10px rgba(0,0,0,.25);
}

/* Downsize the brand/project name a bit */
.navbar .brand {
  padding: 14px 20px 16px; /* Increase vertical padding to match navbar links */
  font-size: 16px;
  font-weight: bold;
  text-shadow: 0 -1px 0 rgba(0,0,0,.5);
}

/* Navbar links: increase padding for taller navbar */
.navbar .nav > li > a {
  padding: 15px 20px;
}

/* Offset the responsive button for proper vertical alignment */
.navbar .btn-navbar {
  margin-top: 10px;
}



/* CUSTOMIZE THE CAROUSEL
-------------------------------------------------- */

/* Carousel base class */
.carousel {
  margin-bottom: 60px;
}

.carousel .container {
  position: relative;
  z-index: 9;
}

.carousel-control {
  height: 80px;
  margin-top: 0;
  font-size: 120px;
  text-shadow: 0 1px 1px rgba(0,0,0,.4);
  background-color: transparent;
  border: 0;
  z-index: 10;
}

.carousel .item {
  height: 500px;
}
.carousel img {
  position: absolute;
  top: 0;
  left: 0;
  min-width: 100%;
  height: 500px;
}

.carousel-caption {
  background-color: transparent;
  position: static;
  max-width: 550px;
  padding: 0 20px;
  margin-top: 200px;
}
.carousel-caption h1,
.carousel-caption .lead {
  margin: 0;
  line-height: 1.25;
  color: #fff;
  text-shadow: 0 1px 1px rgba(0,0,0,.4);
}
.carousel-caption .btn {
  margin-top: 10px;
}



/* MARKETING CONTENT
-------------------------------------------------- */

/* Center align the text within the three columns below the carousel */
.marketing .span4 {
  text-align: center;
}
.marketing h2 {
  font-weight: normal;
}
.marketing .span4 p {
  margin-left: 10px;
  margin-right: 10px;
}


/* Featurettes
------------------------- */

.featurette-divider {
  margin: 80px 0; /* Space out the Bootstrap <hr> more */
}
.featurette {
  padding-top: 120px; /* Vertically center images part 1: add padding above and below text. */
  overflow: hidden; /* Vertically center images part 2: clear their floats. */
}
.featurette-image {
  margin-top: -120px; /* Vertically center images part 3: negative margin up the image the same amount of the padding to center it. */
}

/* Give some space on the sides of the floated elements so text doesn't run right into it. */
.featurette-image.pull-left {
  margin-right: 40px;
}
.featurette-image.pull-right {
  margin-left: 40px;
}

/* Thin out the marketing headings */
.featurette-heading {
  font-size: 50px;
  font-weight: 300;
  line-height: 1;
  letter-spacing: -1px;
}



/* RESPONSIVE CSS
-------------------------------------------------- */

@media (max-width: 979px) {

  .container.navbar-wrapper {
    margin-bottom: 0;
    width: auto;
  }
  .navbar-inner {
    border-radius: 0;
    margin: -20px 0;
  }

  .carousel .item {
    height: 500px;
  }
  .carousel img {
    width: auto;
    height: 500px;
  }

  .featurette {
    height: auto;
    padding: 0;
  }
  .featurette-image.pull-left,
  .featurette-image.pull-right {
    display: block;
    float: none;
    max-width: 40%;
    margin: 0 auto 20px;
  }
}


@media (max-width: 767px) {

  .navbar-inner {
    margin: -20px;
  }

  .carousel {
    margin-left: -20px;
    margin-right: -20px;
  }
  .carousel .container {

  }
  .carousel .item {
    height: 300px;
  }
  .carousel img {
    height: 300px;
  }
  .carousel-caption {
    width: 65%;
    padding: 0 70px;
    margin-top: 100px;
  }
  .carousel-caption h1 {
    font-size: 30px;
  }
  .carousel-caption .lead,
  .carousel-caption .btn {
    font-size: 18px;
  }

  .marketing .span4 + .span4 {
    margin-top: 40px;
  }

  .featurette-heading {
    font-size: 30px;
  }
  .featurette .lead {
    font-size: 18px;
    line-height: 1.5;
  }

}
</style>

<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
  <script src="../assets/js/html5shiv.js"></script>
<![endif]-->

<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144" href="../assets/ico/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114" href="../assets/ico/apple-touch-icon-114-precomposed.png">
  <link rel="apple-touch-icon-precomposed" sizes="72x72" href="../assets/ico/apple-touch-icon-72-precomposed.png">
                <link rel="apple-touch-icon-precomposed" href="../assets/ico/apple-touch-icon-57-precomposed.png">
                               <link rel="shortcut icon" href="../assets/ico/favicon.png">

Question - I would like to be able to move these styles into the actual bootsstrap.css

I am relatively new to html . I understand that I should just copy paste them into the corresponding style on the css such as move body into body. Although this works sometimes when i try and do this for all of them It just screws up the website.

Side question - Would it be worth it just to leave them in the "< head >"? is this how you are meant to take from a example?



Solution :

What you should do, ideally, is to take everything you have between your <style> tags, and move it to its own file, such as myStyles.css. Then, simply add a link to that file in place of your <style> tags

<link href="css/myStyles.css" rel="stylesheet">

    CSS Howto..

    How do I convert a text to css hex value?

    How to properly add divs inside another div so the original design doesn't break?

    how to make two functionality in one button.CSS BOOTSTRAP

    How to create this style of nav bar using exclusively HTML5 and CSS?

    How to make three DIV align vertical if not enough space horizontal

    How to select XML element by xlink:href attribute with CSS?

    How to vertically center more than one line of text (works only on chrome)?

    How do I make a class/div behave like it were floating?

    How do I use CSS with simple form?

    How to inject a css class into an MvcHtmlString?

    PHP databases - don't want to show javascript code

    how to stop css/jquery rotation

    how to make edges of a line fade out?

    Skeleton CSS - how to span the width of the screen?

    How do I align my navbar so it's permanently in the middle of my white box (without padding etc)?

    How to partly color the border with css [closed]

    How to show div property that is in a class with javascript

    How can I center this textbox using CSS?

    How to tell the code to choose between two variables and make them equal?

    CSS element class - Height differs based on content, how to fix?

    How to show an image on html page using only css?

    How to change nav text color when scrolled over other div anchors in the page

    How to align logo and text in bootstrap on small screens?

    How do I keep an element from pushing another element in CSS?

    How do I add or change the class attribute of a JSF dataTable (primefaces)?

    How to hover span content from li

    How to change color of text from left to right along with the background?

    How can I change Bootstrap table-striped in a less specific way?

    How to make a dynamic html form using css and js

    how to show background image(multiple) if out of current div