http://jsfiddle.net/RyanHell078/MgcDU/6511/
I am working through my first project using Twitter's Bootsrap. I have
tried to understand why my H2 classes are not separated when viewing on a
smaller display, but they are fine when viewing on a full desktop view.
I like Bootstrap overall, but I am still stuck. I have tried multiple
remedies and searched high and low and I am still unable to determine an
exact cause or better way to implement the titles for these image divs.
My project is to create a gallery site with 6 image tiles on the homepage
(index.html). I will be adding some JavaScript, modals, and tooltips etc
later. For now I need to get my layout sharp and working properly.
I decided to use a fluid layout. I created a 'fluid container', then filled
it with some rows and spans.My code looks like this:
my index.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>My Gallery Site</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<!-- Stylesheets -->
<link href="css/bootstrap.css" rel="stylesheet">
<link href="css/bootstrap-responsive.css" rel="stylesheet">
<!-- My Stylesheet -->
<link href="css/style.css" rel="stylesheet">
<!-- responsive fallbacks for apple and ie -->
<!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
<!--[if lt IE 9]>
<script src="js/html5shiv.js"></script>
<![endif]-->
<!-- Fav and touch icons -->
<link rel="apple-touch-icon-precomposed" sizes="144x144"
href="img/apple-touch-icon-144-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="114x114"
href="img/apple-touch-icon-114-precomposed.png">
<link rel="apple-touch-icon-precomposed" sizes="72x72"
href="img/apple-touch-icon-72-precomposed.png">
<link rel="apple-touch-icon-precomposed"
href="img/apple-touch-icon-57-precomposed.png">
<link rel="shortcut icon" href="img/favicon.png">
<script type="text/javascript" src="js/jquery.min.js"></script>
<script type="text/javascript" src="js/bootstrap.min.js"></script>
<script type="text/javascript" src="js/scripts.js"></script>
</head>
<!-- Navigation -->
<style type="text/css">
body { background: black; }
</style>
<!-- fluid container start -->
<div class="container-fluid">
<div class="row-fluid">
<!-- horizontal bar top of body -->
<div class="span12"><a class="brand" href="index.html">
<img src="/assets/images/logo.png"></a>
<div class="wrapper"><h1><br><p
style="color:white;margin-left:20px;">
Welcome to my Gallery Site</p></h1>
</div>
<!-- navbar -->
<div class="navbar navbar-inverse">
<div class="navbar-inner">
<div class="container-fluid">
<a data-target=".navbar-responsive-collapse"
data-toggle="collapse" class="btn btn-navbar">
</a> <a href="#" class="brand">My Gallery 2013</a>
<div class="nav-collapse collapse
navbar-responsive-collapse">
<ul class="nav">
<li class="active">
<a
href="mysiteurl.com/theArtist.htm">Artist</a>
</li>
<li>
<a href="mysiteurl.com/artNews.htm">Art
News</a>
</li>
<li>
<a
href="mysiteurl.com/commissions.htm">Commissions</a>
</li>
<li class="dropdown">
<a data-toggle="dropdown"
class="dropdown-toggle" href="#">Gallaries<br></a>
<ul class="dropdown-menu">
<li>
<a href="#">Action</a>
</li>
<li>
<a href="#">Another action</a>
</li>
<li>
<a href="#">Something else
here</a>
</li>
<li class="divider">
</li>
<li class="nav-header">
contact me
</li>
<li>
<div>
<a
href="mailto:[email protected]">email me</a>
<strong>my phone number
here</strong>
</div>
</li>
</ul>
</li>
</ul>
<ul class="nav pull-right">
<li>
<a href="#">resources</a>
</li>
<li class="divider-vertical">
</li>
<li class="dropdown">
<a data-toggle="dropdown"
class="dropdown-toggle" href="#">Galleries
</a>
<ul class="dropdown-menu">
<li>
<a href="#">action</a>
</li>
<li>
<a href="#">another action</a>
</li>
<li>
<a href="#">something else
here</a>
</li>
<li class="divider">
</li>
<li>
<a href="#">separated link</a>
</li>
</ul>
</li>
</ul>
</div>
</div>
</div>
</div>
<body>
<!-- Main Body Container →
<div class="container-fluid">
<div class="row-fluid">
<!-- span for music -->
<div class="span4">
<div class="image">
<img src="assets/images/music.jpg" alt="music" />
<h2 class="music">music</h2>
</div>
</div>
<!-- end of span for music -->
<!-- span for bio -->
<div class="span4">
<div class="image">
<img src="assets/images/about.jpg" alt="artist
biography" />
<h2 class="music">bio</h2>
</div>
</div>
<!-- end of span for bio -->
<!-- span for new art -->
<div class="span4">
<div class="image">
<img src="assets/images/newart.jpg" alt="new art" />
<h2 class="illuminatedanddecor">new art</h2>
</div>
</div><!-- end of span for new art -->
</div><!-- end row fluid -->
<!-- /////////////////// Second tile content row
//////////////////////// -->
<div class="row-fluid">
<!-- span for illuminated & decor -->
<div class="span4">
<div class="image">
<img src="assets/images/illumanddecor.jpg"
alt="illuminated and decor art" />
<h2 class="illuminatedanddecor">illuminated &
decor</h2>
</div>
</div>
<!-- end of span for illuminated & decor -->
<!-- span for commissions -->
<div class="span4">
<div class="image">
<img src="assets/images/commissions.jpg"
alt="commissions" />
<h2 class="illuminatedanddecor">commissions</h2>
</div>
</div>
<!-- end of span for commissions -->
<!-- span for ceramics -->
<div class="span4">
<div class="image">
<img src="assets/images/ceramics.jpg" alt="ceramics" />
<h2 class="music">ceramics</h2>
</div>
</div>
<!-- end of span for ceramics -->
</div><!-- end row fluid -->
</div> <!-- /end container fluid-->
</body>
</html>
// My Custom Style Sheet //
/* Footer Border Top */
hr.style-one {
border: 0;
height: 1px;
background: #333;
background-image: -webkit-linear-gradient(left, #ccc, #333, #ccc);
background-image: -moz-linear-gradient(left, #ccc, #333, #ccc);
background-image: -ms-linear-gradient(left, #ccc, #333, #ccc);
background-image: -o-linear-gradient(left, #ccc, #333, #ccc);
}
div.horizontalRule {
clear:both;
width:100%;
background-color:#d1d1d1;
height:3px;
margin-top:10px;
margin-bottom:10px;
}
body {
max-width:950px;
background-color:black;
margin: 0 auto;
font color: white;
}
/* element blocks */
#container
{
height:100%;
width:auto;
position:relative;
}
.image {
position: relative;
width: 100%; /* for IE 6 */
}
/* custom h2's for each image tile (div) header */
/* music heading */
H2.music {
background:rgba(150, 150, 150, 0.5);
text-align:left;
padding-top:77px;
position: absolute;
top: 50px;
left: auto;
width: 100%;
color: #FFFFFF;
}
/* bio heading */
H2.bio {
background:rgba(170, 187, 97, 0.5);
text-align:left;
position: absolute;
top: 50px;
left: auto;
width: 100%;
color: #FFFFFF;
}
/* new art heading */
H2.newart {
background:rgba(150, 150, 150, 0.5);
text-align:left;
padding-top:77px;
position: absolute;
top: 50px;
left: auto;
width: 100%;
color: #FFFFFF;
}
/* illuminated and decor */
H2.illuminatedanddecor {
background: rgba(170, 187, 97, 0.5);
text-align:left;
position: absolute;
top: 50px;
left: auto;
width: 100%;
color: #FFFFFF;}
}
/* commissions heading */
H2.commissions {
background:rgba(109, 255, 36, .75);
text align:right;
position: absolute;
top: 50px;
left: auto;
width: 100%;
color: #FFFFFF;}
}
/* ceramics heading */
H2.ceramics {
background: rgba(2, 6, 143, 0.5);
text align:right;
position: absolute;
top: 50px;
left: auto;
width: 100%;
color: #FFFFFF;}
}
/* end custom headers for tiles */
.wrapper {
background-image:
url(http://nwtronix.com/word/assets/images/navbartile.jpg);
background-repeat: repeat-x;
background-size: height="100%" width="auto";
width: 100%;
height: 100%;
}
/* header */
h1 {
font-family: 'Satisfy', cursive;
font-color: '#E5E4E2';
}
/* Copyright */
copyright {
font-color: '#333333';
}
/* Bar Background for H2's */
.bar {
height: 22px;
padding-top: opx;
-moz-opacity: 0.5;
-khtml-opacity: 0.5;
opacity: 0.5;
filter: alpha(opacity=50);
background: black;
border-top: 3px solid #ccc;
border-bottom: 3px solid #ccc;
margin-top: 5.0em;
}
p {
margin-left: 20px;
}
For now I have laid out a responsive theme. I created a fluid container.
Inside of the fluid-container I created a row fluid, inside of which are 3
span-4’s. There are two rows of these span4’s inside one single container.
I am looking for help with understanding what I am doing wrong with CSS
regarding the H2 classes here.
What I did was create some h2 alternatives for each image tile (div). The
H2’s define the way I want each title’s title to be. Since the tile’s
titles will be on varying background images, I think I need to be able to
uniquely position the titles depending on each image. I hoped to use some
background opacities to help the titles pop out a bit more from their
background images.
My understanding is a custom h2 selector will allow me to create unique
styles for any div that I select the custom h2 style inside of. Why the h2
styles are all staying linked when viewing on a small screen is stumping me.
Why are my H2’s all clustered on one single image tile div, when I view in
a small display? What am I missing or messing up. I appreciate any and all
help and will +1 the best answer.
Thank you
--
You received this message because you are subscribed to the Google Groups
"twitter-bootstrap" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.