Vue 3 make same multiple cards with different contents - css

I got this result: Content got double but, not cloning as a card element
here's the code
<script setup>
import { ref } from 'vue';
defineProps({
project: String,
});
const projectList = ref([
{
img: './src/assets/img/Pp.png',
tag: 'React JS',
name: 'Destination List App',
desc: 'Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas..',
},
{
img: './src/assets/img/PP2.png',
tag: 'HTML CSS JS',
name: 'City Specialties App',
desc: 'Etiam ultricies nisi vel augue. Curabitur ullamcorper ultricies nisi. Nam eget dui. Etiam rhoncus. Maecenas..',
},
]);
</script>
and here is the template tag
<div>
<!-- I want this whole element below to be multiplied -->
<div class="col-md-4">
<div class="card card--project">
<img class="card__img" v-for="project in projectList" v-bind:key="project.img" :src="project.img" alt="" />
<div class="card__text">
<p class="project-label text-md text-md--md" v-for="project in projectList" v-bind:key="project.tag">{{ project.tag }}</p>
<h4 class="text-gradient-primary" v-for="project in projectList" v-bind:key="project.name">{{ project.name }}</h4>
<p class="project-desc text-md" v-for="project in projectList" v-bind:key="project.desc">{{ project.desc }}</p>
Read More
</div>
</div>
</div>
</div>
I want to make a card section that look like this

That's because you are looping all the images, tags, etc individually. As you said you want the whole element to be multiplied in your comments, that's what you need to do, loop the whole card.
<div>
<!-- I want this whole element below to be multiplied -->
<div class="col-md-4" v-for="(project,id) in projectList" v-
bind:key="project.id" >
<div class="card card--project">
<img class="card__img" " :src="project.img" alt="" />
<div class="card__text">
<p class="project-label text-md text-md--md" >{{ project.tag }}</p>
<h4 class="text-gradient-primary">{{ project.name }}</h4>
<p class="project-desc text-md" >{{ project.desc }}</p>
Read More
</div>
</div>
</div>
</div>

Related

offset in grid system doesn't take effect?

this is my code:
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="row">
<div style={{border: 'solid black 0.5px'}} class="col-md-3">
<h2>Heading 1</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus,</p>
<p><a className="btn btn-secondary" href="#" role="button">View details »</a></p>
</div>
<div style={{border: 'solid black 0.5px'}} class="col-md-3 offset-md-4">
<h2>Heading 2</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, </p>
<p><a className="btn btn-secondary" href="#" role="button">View details »</a></p>
</div>
<div style={{border: 'solid black 0.5px'}} class="col-md-3 offset-md-1">
<h2>Heading 2</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, </p>
<p><a className="btn btn-secondary" href="#" role="button">View details »</a></p>
</div>
</div>
I have used offset on heading 2, the one in the center but it doesn't skip some space unlike in the docs? what I wanted to do is add some margin on them but when I try to, it pushes the last one on the bottom or it doesn't occupy all the space, if I don't use 4? how do I add margin here?
It's col-md-offset-4 and not offset-md-4
read better the docs again https://getbootstrap.com/docs/3.3/css/#grid-offsetting

how to solve : foreach statement cannot operate

I have a controller called "BookController" :
public ActionResult Book(int? id)
{
var result = db.Books.Where(b => b.Book_id == id).Single();
var user = db.AspNetUsers.Where(b => b.Id == result.User_ID).Single();
ViewBag.User_ID = user.UserName;
return View(result);
}
public ActionResult SameAuthor(string author)
{
var result = db.Books.Where(b => b.Author_name == author).Take(4);
return View(result.ToList());
}
also this is the view code "books.cshtml" :
#model SmartBookLibrary.Models.Book
#using SmartBookLibrary.Controllers
#{
ViewBag.Title = Model.Book_name;
BookController book = new BookController();
var auth = Model.Author_name;
}
#section AdditionalMeta
{
<link href="~/Content/blog-post.css" rel="stylesheet" />
<link href="~/Content/font-awesome.min.css" rel="stylesheet" />
}
<div class="container">
<div class="row">
<!-- Blog Post Content Column -->
<div class="col-lg-8">
<!-- Blog Post -->
<!-- Title -->
<h1>#Model.Book_name (#Model.Edition th Edition) <small class="fa fa-edit"></small></h1>
<!-- Author -->
<p class="lead">
by #ViewBag.User_ID
</p>
<hr>
<!-- Date/Time -->
<p><span class="glyphicon glyphicon-time"></span> Posted on #Model.Publish_date</p>
<hr>
<!-- Preview Image -->
<div class="row">
<div class="col-md-3">
<img class="img-show" src="/Books/RetrieveImage/#Model.Book_id" alt="">
</div>
<div class="col-md-6 col-md-offset-1">
<dl>Book Name : #Model.Book_name</dl>
<dl>Book Edition : #Model.Edition</dl>
<dl>Author Name : #Model.Author_name</dl>
<dl>Category : #Model.Category.Category_name</dl>
<dl>Book Name: #Model.Book_name</dl>
<dl>ISN : 2015</dl>
</div>
</div>
<hr>
<!-- Post Content -->
<p class="lead">#Html.Raw(Model.Book_Description)</p>
<button class="btn btn-block btn-lg btn-success">
Download #Model.Book_name
<i class="fa fa-cloud-download"></i>
</button>
<hr>
<div class="well">
<div class="row">
#* I Want to call the contoller method , it will return 4 post , then i want to show them here *#
#{
var b = book.SameAuthor(auth);
foreach (var cat in b)
{
<div class="col-sm-6 col-md-3">
<div class="thumbnail">
<img src="/Books/RetrieveImage/" alt="Generic placeholder thumbnail">
</div>
<div class="caption">
<h3>Book_name</h3>
<p>Some sample text. Some sample text.</p>
<p>
<a href="#" class="btn btn-primary" role="button">
Button
</a>
<a href="#" class="btn btn-default" role="button">
Button
</a>
</p>
</div>
</div>
}
}
</div>
</div>
<hr>
<!-- Blog Comments -->
<!-- Comments Form -->
<div class="well">
<h4>Leave a Comment:</h4>
<form role="form">
<div class="form-group">
<textarea class="form-control" rows="3"></textarea>
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</form>
</div>
<hr>
<!-- Posted Comments -->
<!-- Comment -->
<div class="media">
<a class="pull-left" href="#">
<img class="media-object" src="http://placehold.it/64x64" alt="">
</a>
<div class="media-body">
<h4 class="media-heading">
Start Bootstrap
<small>August 25, 2014 at 9:30 PM</small>
</h4>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
</div>
</div>
<!-- Comment -->
<div class="media">
<a class="pull-left" href="#">
<img class="media-object" src="http://placehold.it/64x64" alt="">
</a>
<div class="media-body">
<h4 class="media-heading">
Start Bootstrap
<small>August 25, 2014 at 9:30 PM</small>
</h4>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
<!-- Nested Comment -->
<div class="media">
<a class="pull-left" href="#">
<img class="media-object" src="http://placehold.it/64x64" alt="">
</a>
<div class="media-body">
<h4 class="media-heading">
Nested Start Bootstrap
<small>August 25, 2014 at 9:30 PM</small>
</h4>
Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
</div>
</div>
<!-- End Nested Comment -->
</div>
</div>
</div>
<!-- Blog Sidebar Widgets Column -->
<div class="col-md-4">
<!-- Blog Search Well -->
<div class="well">
<h4>Search</h4>
<div class="input-group">
<input type="text" class="form-control">
<span class="input-group-btn">
<button class="btn btn-default" type="button">
<span class="glyphicon glyphicon-search"></span>
</button>
</span>
</div>
<!-- /.input-group -->
</div>
<!-- Blog Categories Well -->
<div class="well">
<h4>Blog Categories</h4>
<div class="row">
<div class="col-lg-6">
<ul class="list-unstyled">
<li>
Category Name
</li>
<li>
Category Name
</li>
<li>
Category Name
</li>
<li>
Category Name
</li>
</ul>
</div>
<div class="col-lg-6">
<ul class="list-unstyled">
<li>
Category Name
</li>
<li>
Category Name
</li>
<li>
Category Name
</li>
<li>
Category Name
</li>
</ul>
</div>
</div>
<!-- /.row -->
</div>
<!-- Side Widget Well -->
<div class="well">
<h4>Books May You Interest</h4>
</div>
</div>
</div>
<!-- /.row -->
</div>
my problem actually here in this code "in books.cshtml":
#{
var b = book.SameAuthor(auth);
foreach (var cat in b)
{
<div class="col-sm-6 col-md-3">
<div class="thumbnail">
<img src="/Books/RetrieveImage/" alt="Generic placeholder thumbnail">
</div>
<div class="caption">
<h3>Book_name</h3>
<p>Some sample text. Some sample text.</p>
<p>
<a href="#" class="btn btn-primary" role="button">
Button
</a>
<a href="#" class="btn btn-default" role="button">
Button
</a>
</p>
</div>
</div>
}
}
The Error i got is :
Severity Code Description Project File Line Suppression State
Error CS1579 foreach statement cannot operate on variables of type 'System.Web.Mvc.ActionResult' because 'System.Web.Mvc.ActionResult' does not contain a public definition for 'GetEnumerator' SmartBookLibrary C:\Users\Firas\documents\visual studio 2015\Projects\SmartBookLibrary\SmartBookLibrary\Views\Book\Book.cshtml 73 Active
Note : I Tried to change the model type to this :
#model IEnumerable <SmartBookLibrary.Models.Book>
and the error is gone , but i got error for all the view code (any code start with #model) , and this is a sample of error i got:
Severity Code Description Project File Line Suppression State
Error CS1061 'IEnumerable<Book>' does not contain a definition for 'Book_name' and no extension method 'Book_name' accepting a first argument of type 'IEnumerable<Book>' could be found (are you missing a using directive or an assembly reference?) SmartBookLibrary C:\Users\Firas\documents\visual studio 2015\Projects\SmartBookLibrary\SmartBookLibrary\Views\Book\Book.cshtml 4 Active
can any one help me with a solution ! and thanks
The error is self explanatory. SameAuthor() action method returns an ActionResult type. You cannot loop through that !
Looks like your SameAuthor action method returns a view (markup) with the data you wanted. So why not just include that in the main view with Html.Action helper method
#Html.Action("SameAuthor", Model.Author_name)
Or you should create a view model for your view which has the details of one book and the a collection of books for "Books from the same author".
public class BooksDetailsVm
{
public Book Book { set;get;}
public List<Book> BooksFromSameAuthor { set;get;}
}
and in your GET action, load this data
public ActionResult Book(int? id)
{
if (id != null)
{
var vm = new BooksDetailsVm();
var b = db.Books.Where(O => O.Book_id == id).Single();
vm.Book = b;
var user = db.AspNetUsers.Where(P => P.Id == b.User_ID).Single();
vm.BooksFromSameAuthor = db.Books.Where(t => t.Author_name == b.Author_name).Take(4).ToList();
ViewBag.User_ID = user.UserName;
return View(vm);
}
return HttpNotFound();
}
And your view, which is strongly typed to our new BookDetailsVm
#model BookDetailsVm
<h1>#Model.Book.Name</h1>
<h4>Books from same author</h4>
#foreach(var item in Model.BooksFromSameAuthor)
{
<p>#item.Name</p>
}

Columns in row in bootstrap are not filling page width

I have a section of a website that has 2 rows inside a container, both rows have 3 columns of class col-sm-4 and col-md-4. Both rows have 1 image in each column. All images are exactly the same size at 300px wide. The top row displays accurately, the bottom row condenses the 3 columns and leave a big area of wide space on the right side. When using the inspector, The top row columns are appearing as class col-md-4, but the buttom row columns are showing as col-sm-4. I'm not sure if this is whats causing it. I should mention also that the top row columns have paragraphs below each image. When adding the exact same paragraph content to the bottom row in just 1 column, the issue is resolved, but I don't want paragraphs here. I checked out the bootstrap CSS and my own to try and find some sore of style on <p> that could be causing this but couldn't find anything. Each row, and column have the exact same CSS. The code is below:
HTML:
<div class="wrapper">
<div class="row customer-options">
<div class="button-container">
<div class="col-sm-4 col-md-4">
<img class="img-circle img-responsive img-center" src="images/button-icon-map2.png" alt="">
<h2>Title 1</h2>
<p>These marketing boxes are a great place to put some information. These can contain summaries of what the company does, promotional information, or anything else that is relevant to the company. These will usually be below-the-fold.</p>
</div>
<div class="col-sm-4 col-md-4">
<img class="img-circle img-responsive img-center" src="images/button-icon-pref2.png" alt="">
<h2>Title 2</h2>
<p>The images are set to be circular and responsive. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.</p>
</div>
<div class="col-sm-4 col-md-4">
<img class="img-circle img-responsive img-center" src="images/button-icon-add2.png" alt="">
<h2>Title 3</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.</p>
</div>
</div>
</div><!-- /.row -->
</div><!--wrapper-->
<hr>
<div class="wrapper">
<div class="row tap">
<div class="tap-container">
<div class="col-sm-4 col-md-4">
<img class="img-circle img-responsive img-center" src="images/beer-tap.png" alt="">
<h2>About</h2>
</div>
<div class="col-sm-4 col-md-4">
<img class="img-circle img-responsive img-center" src="images/beer-tap.png" alt="">
<h2>Services</h2>
</div>
<div class="col-sm-4 col-md-4">
<img class="img-circle img-responsive img-center" src="images/beer-tap.png" alt="">
<h2>Contact</h2>
</div>
</div>
</div><!-- /.row -->
</div><!--wrapper-->
CSS:
.wrapper {
display: table;
}
.button-container {
padding-right: 15px;
padding-left: 15px;
}
.customer-options {
background-color: #848487;
padding-top: 20px;
height:100vh;
display: table-cell;
vertical-align: middle;
}
.tap {
background-color: #848487;
padding-top: 20px;
height:100vh;
display: table-cell;
vertical-align: middle;
text-align: center;
}
.tap-container {
padding-right: 15px;
padding-left: 15px;
}
.customer-options h2 {
text-align: center;
}
The display table and table-cell are taking precedence over the responsive image. Tables fit their content then the img-responsive will fill the new width. You can probably find a work around to achieve vertical alignment but I recommend dropping the table system and properly use bootstrap's grid system. Then you can use flexboxes to get vertical alignment.
http://jsfiddle.net/28qq8fm3/
<style>
.customer-options {
background-color: #848487;
padding-top: 20px;
vertical-align: middle;
}
.tap {
background-color: #848487;
padding-top: 20px;
vertical-align: middle;
text-align: center;
}
.customer-options h2 {
text-align: center;
}
</style>
<div>
<div class="row customer-options">
<div class="col-sm-4 col-md-4">
<img class="img-circle img-responsive img-center" src="https://beccasheppard.files.wordpress.com/2011/09/football.jpg" alt="">
<h2>Title 1</h2>
<p>These marketing boxes are a great place to put some information. These can contain summaries of what the company does, promotional information, or anything else that is relevant to the company. These will usually be below-the-fold.</p>
</div>
<div class="col-sm-4 col-md-4">
<img class="img-circle img-responsive img-center" src="https://beccasheppard.files.wordpress.com/2011/09/football.jpg" alt="">
<h2>Title 2</h2>
<p>The images are set to be circular and responsive. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.</p>
</div>
<div class="col-sm-4 col-md-4">
<img class="img-circle img-responsive img-center" src="https://beccasheppard.files.wordpress.com/2011/09/football.jpg" alt="">
<h2>Title 3</h2>
<p>Donec id elit non mi porta gravida at eget metus. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui.</p>
</div>
</div>
<!-- /.row -->
</div>
<!--wrapper-->
<hr>
<div>
<div class="row tap">
<div class="col-sm-4 col-md-4">
<img class="img-circle img-responsive img-center" src="http://www.cozadschools.net/wp-content/uploads/2015/02/football.png" alt="">
<h2>About</h2>
</div>
<div class="col-sm-4 col-md-4">
<img class="img-circle img-responsive img-center" src="http://www.cozadschools.net/wp-content/uploads/2015/02/football.png" alt="">
<h2>Services</h2>
</div>
<div class="col-sm-4 col-md-4">
<img class="img-circle img-responsive img-center" src="http://www.cozadschools.net/wp-content/uploads/2015/02/football.png" alt="">
<h2>Contact</h2>
</div>
</div>
<!-- /.row -->
</div>
<!--wrapper-->

CSS Stylesheet for Custom Joomla Template isn't showing

So I have currently used basic html and css coding to create a website for a client. The template uploads to the extension manager but when I go to preview it, the page looks nothing like it's supposed to. None of the styles from my css stylesheet are showing up. I'm new to Joomla so some help for this newbie would be greatly appreciated. If you need any more information I will be glad to give it. Unfortunately I am unable to provide a link since the site isn't live yet but will give you guys links to some screen shots.
EDIT:
<?php
defined('_JEXEC') or die;
?>
<!Doctype html>
<html>
<head>
<meta charset="utf-8">
<title> Deda's Couture</title>
<link rel="stylesheet" href="css/normalize.css">
<link rel="stylesheet" href="css/main.css">
<link rel="stylesheet" href="css/responsive.css">
<link rel="stylesheet" href="css/component.css">
<meta="viewport" content="width=device-width, initial-scale=1.0">
<jdoc:include type="head" />
<!--[if lt IE 9]>
<script src="<?php echo $this->baseurl ?>/media/jui/js/html5.js"></script>
<![endif]-->
</head>
<body class="content">
<header>
<div id="topbar">
<img width="40" height="30" src="images/drupal.svg" alt="" id="drupal">
<img width="40" height="30" src="images/facebook-square.svg" alt="" id="facebook">
<img width="40" height="30" src="images/instagram.svg" alt="" id="instagram">
<img width="40" height="30" src="images/twitter.svg" alt="" id="twitter">
<p>1-800-555-5252</p>
</div>
<input type="checkbox" id="menuToggle">
<label for="menuToggle" class="menu-icon">&#9776</label>
<center><img src="images/logo.jpg"></center>
<div id="nav">
<div id="nav_wrapper">
<!-- <ul>
<li>HOME</li>
<li>NEW ARRIVALS</li><li>
APPAREL<img src="images/dropdownarrow.jpg">
<ul>
<li>MENS</li>
<li>WOMENS</li>
<li>CHILDREN</li>
</ul></li>
<li>ACCESSORIES</li>
<li>SHOES</li>
<li>SPECIALS</li>
<li>CONTACT US</li>
</ul> -->
<jdoc:include type="modules" name="mainnav" style="html5" />
</div>
</div>
<nav class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-right menu">
<h3 class="cbp-spmenu-open">Menu</h3>
<!-- HOME
NEW ARRIVALS
APPAREL
ACCESSORIES
SHOES
SPECIALS
CONTACT US -->
<jdoc:include type="modules" name="mobilenav" style="html5" />
</nav>
<!-- <button id="showLeftPush">Show/Hide Left Push Menu</button><img id="menu-icon" src="images/menu-icon.svg"></button>
-->
<!-- <img src="images/topbanner.jpg" width="100%"> -->
<section class="banner">
<jdoc:include type="modules" name="banner" style="html5" /></section>
</header>
<div id="wrapper">
<section>
<p class="locate"><!-- HOME // APPAREL // WOMEN'S APPAREL -->
<jdoc:include type="modules" name="breadcrumbs" style="html5"</p>
<!-- <ul id="gallery">
<li>
<img src="images/productbox.jpg">
<p> LOREM IPSA DIPA </p>
<p>179.00</p></li>
<li>
<img src="images/productbox.jpg">
<p> LOREM IPSA DIPA </p>
<p>179.00</p></li>
<li>
<img src="images/productbox.jpg">
<p> LOREM IPSA DIPA </p>
<p>179.00</p></li>
<li>
<img src="images/productbox.jpg">
<p> LOREM IPSA DIPA </p>
<p>179.00</p></li>
</ul> -->
<jdoc:include type="modules" name="gallery" style="html5" />
<!-- <h2>HEADLINE</h2>
<p class="primarycontent">Lorem ipsum dolor sit amet, consectetur adipiscing elit. Proin laoreet faucibus commodo. Cras consectetur ligula et leo rutrum, ac porttitor ipsum lacinia. Nulla volutpat nisl ante, id consequat diam faucibus efficitur. Duis quis placerat tortor. Aenean pharetra maximus bibendum. Donec posuere mauris at est efficitur hendrerit. In sodales nisi nec lorem sollicitudin aliquam.
Suspendisse vel blandit nulla. Vivamus fringilla tortor condimentum convallis vehicula. Suspendisse potenti. Aliquam tempor quam sit amet auctor interdum. Vivamus condimentum mauris a odio scelerisque elementum. Etiam fermentum lorem id commodo placerat. Ut scelerisque nibh eu feugiat euismod.</p> -->
<jdoc:include type="message" />
<jdoc:include type="component" />
</section>
</div>
<footer>
<!-- <div id="bottom-nav">
<nav>
HOME
NEW ARRIVALS
APPAREL
ACCESSORIES
SHOES
SPECIALS
CONTACT US
</nav> -->
<jdoc:include type="modules" name="submenu" style="html5" />
<img src="images/bottomlogo.jpg" alt="">
</div>
<p><span class="copyright">COPYRIGHT &copy 2015 DEDA'S COUTURE BY 3 | ALL RIGHTS RESERVED</span> <span class="credits">
RESPONSIVE WEBSITE DESIGNED BY FREEDOM CREATIVE SOLUTIONS</span><p>
</footer>
<script>
var menuLeft = document.getElementById( 'cbp-spmenu-s1' ),
menuRight = document.getElementById( 'cbp-spmenu-s2' ),
menuTop = document.getElementById( 'cbp-spmenu-s3' ),
menuBottom = document.getElementById( 'cbp-spmenu-s4' ),
showLeft = document.getElementById( 'showLeft' ),
showRight = document.getElementById( 'showRight' ),
showTop = document.getElementById( 'showTop' ),
showBottom = document.getElementById( 'showBottom' ),
showLeftPush = document.getElementById( 'showLeftPush' ),
showRightPush = document.getElementById( 'showRightPush' ),
body = document.body;
showLeft.onclick = function() {
classie.toggle( this, 'active' );
classie.toggle( menuLeft, 'cbp-spmenu-open' );
disableOther( 'showLeft' );
};
function disableOther( button ) {
if( button !== 'showLeft' ) {
classie.toggle( showLeft, 'disabled' );
}
</script>
</body>
</html>

Bootstrap div / rows not positioning correct

I am fairly new with bootstrap, however I am trying to create a basic website. I have the below code in my index:
<!DOCTYPE html>
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<link rel="shortcut icon" href="http://getbootstrap.com/assets/ico/favicon.png">
<title>BoonRadio: Playing the latest hits for you!</title>
<!-- Bootstrap core CSS -->
<link href="../bootstrap/css/bootstrap.css" rel="stylesheet">
<!-- Bootstrap theme -->
<link href="../bootstrap/css/bootstrap-theme.min.css" rel="stylesheet">
<!-- Custom styles for this template -->
<link href="http://../bootstrap/css/theme.css" rel="stylesheet">
<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="../../assets/js/html5shiv.js"></script>
<script src="../../assets/js/respond.min.js"></script>
<![endif]-->
<style type="text/css"></style><style id="holderjs-style" type="text/css">.holderjs-fluid {font-size:16px;font-weight:bold;text-align:center;font-family:sans-serif;margin:0}</style><style type="text/css"></style></head>
<script type="text/javascript">
var bustcachevar=1 //bust potential caching of external pages after initial request? (1=yes, 0=no)
var loadedobjects=""
var rootdomain="http://"+window.location.hostname
var bustcacheparameter=""
function ajaxpage(url, containerid){
var page_request = false
if (window.XMLHttpRequest) // if Mozilla, Safari etc
page_request = new XMLHttpRequest()
else if (window.ActiveXObject){ // if IE
try {
page_request = new ActiveXObject("Msxml2.XMLHTTP")
}
catch (e){
try{
page_request = new ActiveXObject("Microsoft.XMLHTTP")
}
catch (e){}
}
}
else
return false
page_request.onreadystatechange=function(){
loadpage(page_request, containerid)
}
if (bustcachevar) //if bust caching of external page
bustcacheparameter=(url.indexOf("?")!=-1)? "&"+new Date().getTime() : "?"+new Date().getTime()
page_request.open('GET', url+bustcacheparameter, true)
page_request.send(null)
}
function loadpage(page_request, containerid){
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
document.getElementById(containerid).innerHTML=page_request.responseText
}
function loadobjs(){
if (!document.getElementById)
return
for (i=0; i<arguments.length; i++){
var file=arguments[i]
var fileref=""
if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
if (file.indexOf(".js")!=-1){ //If object is a js file
fileref=document.createElement('script')
fileref.setAttribute("type","text/javascript");
fileref.setAttribute("src", file);
}
else if (file.indexOf(".css")!=-1){ //If object is a css file
fileref=document.createElement("link")
fileref.setAttribute("rel", "stylesheet");
fileref.setAttribute("type", "text/css");
fileref.setAttribute("href", file);
}
}
if (fileref!=""){
document.getElementsByTagName("head").item(0).appendChild(fileref)
loadedobjects+=file+" " //Remember this object as being already added to page
}
}
}
</script>
<body style="">
<!-- Fixed navbar -->
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="index.php">BoonRadio</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li class="active">Home</li>
<li>Our DJ's</li>
<li>Apply for DJ</li>
<li>Timetable</li>
<li>About</li>
</li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li>Sign In</li>
</ul>
</div><!--/.nav-collapse -->
</div>
</div>
<div class="container">
<img src="../img/banner.png" />
<div class="page-header"></div>
<div class="row">
<div class="col-sm-8" style="float: left;">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam iaculis tincidunt nunc eu iaculis. Curabitur aliquam, purus volutpat tincidunt fermentum, augue erat
scelerisque dui, at aliquet leo lectus quis dui. Nulla congue elit in lacus porttitor, ultricies ultrices ligula porttitor. Praesent faucibus ullamcorper ligula ut
cursus. Vivamus condimentum augue vel dapibus feugiat. Proin vulputate massa at tortor iaculis, in sodales nulla suscipit. Pellentesque commodo venenatis mauris,
vitae feugiat tortor cursus non. Interdum et malesuada fames ac ante ipsum primis in faucibus. Nunc quam nisi, semper non tortor vel, tincidunt eleifend dui.
Curabitur pellentesque, nulla eu blandit condimentum, augue ante posuere nunc, at laoreet velit est ac ipsum. Vivamus neque elit, pellentesque eu justo a,
iaculis lacinia leo. Sed pulvinar dapibus diam et vulputate. In porta sem id lorem vestibulum pulvinar. Suspendisse luctus lorem sit amet condimentum volutpat.
Nullam id pharetra tortor.
<br /><br />
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-4" style="float: right;">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Radio Statistics</h3>
</div>
<div class="panel-body">
Statics code here.
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Quick Requests</h3>
</div>
<div class="panel-body">
Request line code here.
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Facebook</h3>
</div>
<div class="panel-body">
Facebook code here.
</div>
</div>
</div><!-- /.col-sm-4 -->
</div>
<!-- <script type="text/javascript">
ajaxpage('#', 'contentarea')
</script>
<div id="contentarea"></div> -->
<div class="page-header"></div>
<div class="footer">© BoonRadio 2013</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="../bootstrap/js/jquery.js"></script>
<script src="../bootstrap/js/bootstrap.min.js"></script>
<script src="../bootstrap/js/holder.js"></script>
</body></html>
Don't mind the hidden ajax code. Anyways, my divs are doing this:
http://i.imgur.com/HdjKFfS.png
The more I add in the main content box, the further down the 3 divs on the right go down. I am wanting them to stay in place so when I add more content, they don't move down. Even adding margin-top to the col-sm-4 div, they still move down.
http://i.imgur.com/aSs1GqP.png
It might be simple and I'm just not thinking properly, but would someone assist me?
You're misunderstanding how Bootstrap's grid system works. Get rid of the float styles on your column divs and it should work; Bootstrap already provides the correct float styles as part of the grid system. Also you have a stray </li> in your nav header. Also, get your indenting sorted out, it's super inconsistent right now, which makes it harder to read and harder to figure out.
I corrected your indenting. There were some closing </div> tags that were unnecessary. As Nathan said, the floating css is not needed with Bootstrap.
<div class="container">
<img src="../img/banner.png" />
<div class="page-header"></div>
<div class="row">
<div class="col-sm-8">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Panel title</h3>
</div>
<div class="panel-body">
Lorem ipsum ...
</div>
</div>
<div class="col-sm-4">
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Radio Statistics</h3>
</div>
<div class="panel-body">
Statics code here.
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Quick Requests</h3>
</div>
<div class="panel-body">
Request line code here.
</div>
</div>
<div class="panel panel-info">
<div class="panel-heading">
<h3 class="panel-title">Facebook</h3>
</div>
<div class="panel-body">
Facebook code here.
</div>
</div>
</div><!-- /.col-sm-4 -->
</div>
<!-- <script type="text/javascript">
ajaxpage('#', 'contentarea')
</script>
<div id="contentarea"></div> -->
<div class="page-header"></div>
<div class="footer">© BoonRadio 2013</div>
</div>

Resources