There is something there is controlling the height on the div div tag with the green border here:
Can anybody see in the CSS what that is through the developer tools? I cannot figure it out.
I need to make a grid there is looking like this, but the height of the green bordered div tag has been stopping me. The important thing is that the text should still be centered.
This is actually how the code should be, but the height stops that:
Here is the code there is online:
div class="background-image" #Html.Raw(topImageStyling)></div>
<div class="top-area" style="border: 4px solid red;">
<div class="container col-md-8" style="border: 4px solid green;">
#if (!string.IsNullOrEmpty(headerText))
{
if (pageAlias == "Blog")
{
<h1 class="header-xl center">
#Html.Raw(headerText)
</h1>
}
else
{
<p class="header-xl center">
#Html.Raw(headerText)
</p>
}
}
#if (CurrentPage.HasValue("imageTeaserText"))
{
<p class="sub-header center">
#Html.Raw(CurrentPage.imageTeaserText)
</p>
}
</div>
</div>
Per our discussion in the coments, this is how the html should be structured. Then just remove position:absolute; from .background-image and remove min-height:500px; from .container
<div class="background-image" #Html.Raw(topImageStyling)>
<div class="top-area" style="border: 4px solid red;">
<div class="container col-md-8" style="border: 4px solid green;">
#if (!string.IsNullOrEmpty(headerText))
{
if (pageAlias == "Blog")
{
<h1 class="header-xl center">
#Html.Raw(headerText)
</h1>
}
else
{
<p class="header-xl center">
#Html.Raw(headerText)
</p>
}
}
#if (CurrentPage.HasValue("imageTeaserText"))
{
<p class="sub-header center">
#Html.Raw(CurrentPage.imageTeaserText)
</p>
}
</div>
</div>
</div>
Related
When I use it instead puts the div the the top and center
HTML
<div align="center">
<div style="max-width:800px">
<div>
<div>
<div style="CLEAR: none; BORDER-RIGHT: black 1px solid; BORDER-LEFT: black 1px solid" class="Header" align="center">
<div class="Banner">
<div style="max-width:100%">
<div>
<div>
<div align="top" align="left">
<a class="BannerText" href="https://web.archive.org/web/20060528010436/http://www.roblox.com:80/Default.aspx">ROBLOX.com</a></div>
<div align="center" style="max-width:300px">
</div>
<div align="right"><span class="BannerText">
<a class="BannerText" href="https://web.archive.org/web/20060528010436/http://www.roblox.com:80/Login/New.aspx">Sign Up</a></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
CSS
.Header
{
font-size: 14px;
}
.Banner
{
PADDING: 8px;
}
.BannerText
{
font-weight: bold;
color: white;
}
a.BannerText:link, a.BannerText:visited, a.BannerText:active
{
text-decoration: none;
COLOR: white;
}
a.BannerText:hover
{
text-decoration: underline;
COLOR: white;
}
I tried editing it and googling it but I found nothing. This is old HTML code I found on the wayback machine https://web.archive.org/web/20060528010436/http://www.roblox.com:80/ I find the old header interesting and would like to use it for my projects. Even If I update it to HTML5 code, I don't know if using a table instead of a header tag will hurt site optimization/seo
The align property is deprecated. Use the CSS top and left properties, along with a position: fixed attribute. Read more on CSS positioning here.
<div align="center">
<div style="max-width:800px">
<div>
<div>
<div style="CLEAR: none; BORDER-RIGHT: black 1px solid; BORDER-LEFT: black 1px solid" class="Header" align="center">
<div class="Banner">
<div style="max-width:100%">
<div>
<div>
<div style="position:fixed;top:0;left:0;">
<a class="BannerText" href="https://web.archive.org/web/20060528010436/http://www.roblox.com:80/Default.aspx">ROBLOX.com</a></div>
<div align="center" style="max-width:300px">
</div>
<div align="right"><span class="BannerText">
<a class="BannerText" href="https://web.archive.org/web/20060528010436/http://www.roblox.com:80/Login/New.aspx">Sign Up</a></span></div>
</div>
</div>
</div>
</div>
</div>
</div>
It hurt me physically to use the inline CSS style attribute. I would've used a class, but something tells me you're looking for a quick fix. Please take some basic html and css tutorials.
Sorry if the title is confusing. I have included a screenshot of my issue to make it more clear.
Essentially, I want the green-bordered div to be directly underneath the red-bordered div without the blue-bordered div interfering.
Here is my HTML code (I am using Bootstrap v3.3.7)
<div class="container appParent">
<div class="row">
<div class="col-md-6" id="song-view">
<app-selected-song-view></app-selected-song-view>
</div>
<div class="col-md-6" id="songs-added">
<app-songs-added></app-songs-added>
</div>
</div>
<div class="row">
<div class="col-md-6" id="playlist-form">
<app-playlist-form></app-playlist-form>
</div>
</div>
</div>
My CSS is only putting the borders around the div. Everything else is bootstrap.
#song-view{
border: 2px solid red;
}
#songs-added{
border: 2px solid blue;
}
#playlist-form{
border: 2px solid green;
}
In this case, use pull-right, and keep all of the col- in a single row.
<div class="container appParent">
<div class="row">
<div class="col-md-6" id="song-view">
<app-selected-song-view></app-selected-song-view>
</div>
<div class="col-md-6 pull-right col-xs-12" id="songs-added">
<app-songs-added></app-songs-added>
</div>
<div class="col-md-6" id="playlist-form">
<app-playlist-form></app-playlist-form>
</div>
</div>
</div>
http://www.codeply.com/go/189ofQG5Sj
You can re-arrange your HTML.
#song-view {
border: 2px solid red;
height: 100px;
margin-bottom: 30px;
}
#songs-added {
border: 2px solid blue;
height: 150px;
}
#playlist-form {
border: 2px solid green;
height: 100px;
margin-bottom: 30px;
}
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container appParent">
<div class="row">
<div class="col-md-6">
<div id="song-view">
<app-selected-song-view></app-selected-song-view>
</div>
<div id="playlist-form">
<app-playlist-form></app-playlist-form>
</div>
</div>
<div class="col-md-6">
<div id="songs-added">
<app-songs-added></app-songs-added>
</div>
</div>
</div>
</div>
You can simple use min-heights and surround the containers and rows with a div for extra styling. You can check this example I quickly made: JsFiddle
<div class="song-list">
<div class="row">
<div class="container">
<div class="col-md-6" id="song-view">
Song View
</div>
<div class="col-md-6" id="songs-added">
Songs Added
</div>
</div>
</div>
</div>
<div class="playlist">
<div class="row">
<div class="container">
<div class="col-md-6" id="playlist-form">
Playlist Form
</div>
</div>
</div>
</div>
CSS:
.song-list #song-view {
border:1px solid blue;
min-height:300px;
}
.song-list #songs-added {
border:1px solid red;
min-height:500px;
}
.playlist #playlist-form {
border:1px solid green;
}
On this page:(I just set a red and green border to make it more clear)
I have a picture of a book, which need to be in the left side where the black border is:
I have tried to build up the banner with the code below. But I cannot figure out how I can set a div tag that would fit the left side where the black border is.
Does anybody have an advice on how I could do that?. The code there is until now is this:
<div class="top-area" style="border: 4px solid red;">
<div class="container" style="border: 4px solid green;">
#if (!string.IsNullOrEmpty(headerText))
{
if (pageAlias == "Blog")
{
<h1 class="header-xl center">
#Html.Raw(headerText)
</h1>
}
else
{
<p class="header-xl center">
#Html.Raw(headerText)
</p>
}
}
#if (CurrentPage.HasValue("imageTeaserText"))
{
<p class="sub-header center">
#Html.Raw(CurrentPage.imageTeaserText)
</p>
}
</div>
</div>
<div class="container-fluid">
<div class="row">
<div class="container-fluid">
<div class="row">
<div class="col-md-12 main-content" id="main-content">
<div class="row">
<div class="col-lg-12">
#CurrentPage.GetGridHtml("inovoGrid")
</div>
</div>
</div>
</div>
</div>
</div>
</div>
Here's an example on plunkr using the bootstrap columns to keep elements aligned on either side of your title. Bootstrap aligns its grid based on 12 columns. I've only added support for small density screens via col-sm-x, you should experiment with the other densities.
Not sure this is possible with CSS only. Any help is appreciated.
My HTML looks like this:
<div class="row invoice with-tax">
<div class="mobile-body-header mobile"><strong>Items</strong></div>
<div class="invoice-item">
<div class="item-filler"></div>
<div class="quantity">2</div>
<div class="amount-mobile total">$13,336.60</div>
<div class="item-number">ABC123</div>
<div class="title"><span class="quantity-mobile">2 x </span>Dance classes and tutoring for upcoming Michael Jacksons</div>
<div class="amount-item-ex">$153.00</div>
<div class="amount-subtotal">$306.00</div>
<div class="amount-tax">$30.60</div>
<div class="amount-total total">$13,336.60</div>
<div class="item-filler"></div>
</div>
<div class="invoice-item">
<div class="item-filler"></div>
<div class="quantity">2</div>
<div class="amount-mobile total">$13,336.60</div>
<div class="item-number">ABC123</div>
<div class="title"><span class="quantity-mobile">2 x </span>Dance classes and tutoring for upcoming Michael Jacksons</div>
<div class="amount-item-ex">$153.00</div>
<div class="amount-subtotal">$306.00</div>
<div class="amount-tax">$30.60</div>
<div class="amount-total total">$13,336.60</div>
<div class="item-filler"></div>
</div>
....
</div>
I am trying to remove the border-bottom of the final div with class title in the last div with class invoice-item. These are essentially rows of div elements that can vary in numbers (as it is and invoice I am working on).
I have tried unsuccessfully the examples below. Although I can see it working in the Fiddle from #Steve below it is not removing the last border when placed inside the rest of the CSS. And I can confirm the border is set just above per the examples below.
div.invoice-item > div.title {
border-bottom: 2px dotted red;
}
div.invoice-item:last-child > div.title {
border: none !important;
}
also
div.invoice-item > div.title {
border-bottom: 2px dotted red;
}
div.invoice > div.invoice-item:last-child > div.title {
border: none !important;
}
also
div {
border-bottom: 1px solid red;
}
div.invoice-item:last-of-type > div.title {
border: none;
}
Since it's an e-mail template, there are some clients that doesn't support :last-child. Instead of using :last-child, try to add a new Class to the div that you want to select.
Try div.invoice-item:last-of-type > div.title { border: none; }
UPDATE
Since there's an unknown CSS evil, here's a trick that might work:
div.invoice-item:last-of-type > div.title.title { border: none !important; }
div {
border-bottom: 1px solid red;
}
/* div.invoice-item:last-of-type > div.title {
border: none;
} */
div.invoice-item:last-of-type > div.title.title {
border: none !important;
}
<div class="row invoice with-tax">
<div class="mobile-body-header mobile"><strong>Items</strong>
</div>
<div class="invoice-item">
<div class="item-filler"></div>
<div class="quantity">2</div>
<div class="amount-mobile total">$13,336.60</div>
<div class="item-number">ABC123</div>
<div class="title"><span class="quantity-mobile">2 x </span>Dance classes and tutoring for upcoming Michael Jacksons</div>
<div class="amount-item-ex">$153.00</div>
<div class="amount-subtotal">$306.00</div>
<div class="amount-tax">$30.60</div>
<div class="amount-total total">$13,336.60</div>
<div class="item-filler"></div>
</div>
<div class="invoice-item">
<div class="item-filler"></div>
<div class="quantity">2</div>
<div class="amount-mobile total">$13,336.60</div>
<div class="item-number">ABC123</div>
<div class="title"><span class="quantity-mobile">2 x </span>Dance classes and tutoring for upcoming Michael Jacksons</div>
<div class="amount-item-ex">$153.00</div>
<div class="amount-subtotal">$306.00</div>
<div class="amount-tax">$30.60</div>
<div class="amount-total total">$13,336.60</div>
<div class="item-filler"></div>
</div>
....
</div>
When using two div elements and the inline-block the two div's do not stand beside one another.
This is the code. (I configured some of the paragraphs and images to work better. I made sure the result was the same first though.)
<head>
<style>
#line {
display:inline-block;
margin-left:5%;
margin-right:75%;
border: 5px solid orange;
}
#TEST {
width:100%;
}
#pTxt {
text-align:center;
}
#heading {
color: red;
}
</style>
</head>
<body>
<div id="line">
<div>
<img id="TEST" alt="PICTURE" src="test.png" />
<div id="pTxt">
<h3 id="heading">
HEADING
</h3>
<p>TEST</p>
<br/>
<p>TEST</p>
</div>
</div>
</div>
<div id="line">
<img alt="PICTURE" id="TEST" src="test.png" />
<div id="pTxt">
<h3 id="heading">
HEADING
</h3>
<p>TEST</p>
<br/>
<p>TEST</p>
</div>
</div>
</body>
http://jsfiddle.net/gqfmmdy9/1/
Thanks in advance.
You are setting margin-right: 75%, which is pushing the next element to the bottom. You'll have to remove it.
Fiddle
#line {
display:inline-block;
margin-left:5%;
border: 5px solid orange;
}
#line {
display: inline-block;
margin-left: 5%;
border: 5px solid orange;
}
#TEST {
width: 100%;
}
#pTxt {
text-align: center;
}
#heading {
color: red;
}
<div id="line">
<div>
<img id="TEST" alt="PICTURE" src="test.png" />
<div id="pTxt">
<h3 id="heading">
HEADING
</h3>
<p>
TEST
</p>
<br/>
<p>
TEST
</p>
</div>
</div>
</div>
<div id="line">
<img alt="PICTURE" id="TEST" src="test.png" />
<div id="pTxt">
<h3 id="heading">
HEADING
</h3>
<p>
TEST
</p>
<br/>
<p>
TEST
</p>
</div>
</div>
#line {
display:inline-block;
margin-left:5%;
margin-right:75%;
border: 5px solid orange;
}
Your styles are working.
Try swapping margin-right:75%; for margin-right:2%;.
EDIT: Also, I suspect you need to give #line an explicit width declaration. Something like width:12%;.
If you want both the divs side by side, you can use <table> tag. See if this works for you.
<table>
<tr><td><div class="line">
<div>
<img class="TEST" alt="PICTURE" src="test.png"/>
<div class="pTxt">
<h3 class="heading">
HEADING
</h3>
<p>
TEST
</p>
<br/>
<p>
TEST
</p>
</div>
</div>
</div></td>
<td><div class="line">
<img alt="PICTURE" class="TEST" src="test.png"/>
<div class="pTxt">
<h3 class="heading">
HEADING
</h3>
<p>
TEST
</p>
<br/>
<p>
TEST
</p>
</div>
</div></td></tr>
</table>
and CSS
.line {
display:inline-block;
margin-left:5%;
margin-right:75%;
border: 5px solid orange;
}
.TEST {
width:100%;
}
.pTxt {
text-align:center;
}
.heading {
color: red;
}