Struggling to get words and Images inline - html

enter image description hereI am trying to get text underneath the images and have the images inline, I am getting them in line to make a slide show. Please see my code below
HTML:
<div class="slideshow-container">
<div class="mySlides fade">
<img src="images/British citizenship and Immigration.jpg" alt="British citizenship and Immigration Images">
<div class="text"><h6>British citizenship and
Immigration
</h6>
</div>
<div class="mySlides fade">
<img src="images/Australian Migration.jpg" alt="Australian Migration Images">
<div class="text"><h6>Australian Migration</h6>
<p class = "sent">Our team can assist with a range of Australian visa solutions. Our expert knowledge ensures you receive the best advice for your personal circumstances. </p>
</div>
</div>
<img src="images/Citizenship by investment.jpg" alt="Australian Migration Images">
<div class="text"><h6>Citizenship-by-investment</h6>
<p class = "sent">Enjoy the exclusive privileges that dual citizenship and international investment can provide. Our consultants can help you select the right programme and guide you every step of the way. </p>
</div>
<a class="prev" onclick="plusSlides(-1)">❮</a>
<a class="next" onclick="plusSlides(1)">❯</a>
</div>
</div>
CSS
.slideshow-container {
max-width: 1000px;
position: relative;
margin: auto;
}
.mySlides
{
display: flex;
}
I have tried display grid with grid-template-columns, the text does not go underneath and that does not seem to work.
Anyone have a solution?

Try to add display: inline-block on the actual Elements( that is the image and the word)

I managed to get it in line with the text underneath.
HTML
<div class="row">
<div class="column animation">
<img src="images/British citizenship and Immigration.jpg" alt="British citizenship and Immigration">
<h1>British citizenship and Immigration</h1>
</div>
<div class="column">
<img src="images/Australian Migration.jpg" alt="Australian Migration">
<h1>Australian Migration</h1>
<p>Our team can assist with a range of Australian visa solutions. Our expert knowledge ensures you receive the best advice for your personal circumstances.</p>
</div>
<div class="column">
<img src="images/Citizenship by investment.jpg" alt="Citizenship by investment">
<h1>Citizenship-by-investment</h1>
<p>Enjoy the exclusive privileges that dual citizenship and international investment can provide. Our consultants can help you select the right programme and guide you every step of the way.</p>
</div>
<a class="prev" onclick="plusSlides(-1)">❮</a>
<a class="next" onclick="plusSlides(1)">❯</a>
</div>
CSS
.row {
margin-top: 10px;
display: flex;
flex-wrap: wrap;
padding: 0px 8rem 0px 338px;
margin-top: -33vh;
margin-left:10vw;
}
.column {
flex:10%;
padding: 0 4px;
}
.prev, .next {
cursor: pointer;
position: relative;
top: 50%;
width: auto;
margin-top: -22px;
padding: 16px;
color: #115577;
font-weight: bold;
font-size: 30px;
transition: 0.6s ease;
border-radius: 0 3px 3px 0;
user-select: none;
}
.next {
text-decoration: none;
top:7rem;
right: 26rem;
border-radius: 3px 0 0 3px;
}
.prev
{
text-decoration: none;
top:7rem;
left: -126rem;
}
.column h1
{
font-size:16px;
margin-left: 2.5rem;
}
.column img
{
margin-left:1vw;
}
.column p
{
text-align: center;
margin-left: 0rem;
margin-right: 25rem;
}
.animation {
animation-name: animation;
animation-duration: 1.5s;
}
#keyframes animation {
from {opacity: .4}
to {opacity: 1}
}
Thank you all for your help

Related

How can I make two divs appear next to eachother and not under eachother? [duplicate]

This question already has answers here:
Two divs side by side - Fluid display [duplicate]
(9 answers)
Fluid width with equally spaced DIVs
(7 answers)
Closed 2 years ago.
Im still learning html/css therefore I apologize if the code is wrong. I've been doing a replica of a site. There are 4 articles on the down side of the site.
I've created two but the second one always appears under the first one, even though I've gave the div which wraps it "display: inline-block;". I haven't got to learn flexbox yet, any idea how can I fix this?
.subarticle {
background: white;
width: 220px;
height: 350px;
position: absolute;
top: 135%;
left: 20%;
border: 1px solid black;
}
.goodidea {
width: 100%;
height: 40%;
}
.SOČ {
font-family: "Open Sans",sans-serif;
}
.informacie {
margin-top: -15px;
margin-left: 20px;
font-family: "Open Sans",sans-serif;
}
.far {
margin-right: 7px;
}
h3 {
font-size: 15px;
color: red;
text-align: center;
margin-right: 10px;
}
.read {
color: orange;
margin-top: -8px;
margin-left: -10px;
font-weight: 700;
font-size: 12px;
width: 70px;
}
.read:hover {
background: rgb(241, 221, 184);
transition: 0.3s ease;
cursor: pointer;
}
.wrapper {
display: inline-block;
vertical-align: middle;
}
<article>
<div class="subarticle">
<div class="wrapper">
<img src="img/logo2.jpg" alt="logo s textom good idea" class="goodidea">
<div class="informacie">
<h2 class="SOČ">SOČ</h2>
<p class="datum"><i class="far fa-calendar-times"></i>6.1.2021</p>
<h3>
Stredoškolská odborná činnosť <br> <br>
Prekonaj sám seba a ukáž, že máš talent...
</h3>
<p class="read">ČÍTAŤ VIAC</p>
</div>
</div>
<div class="wrapper">
<img src="img/logo2.jpg" alt="logo s textom good idea" class="goodidea">
<div class="informacie">
<h2 class="SOČ">SOČ</h2>
<p class="datum"><i class="far fa-calendar-times"></i>6.1.2021</p>
<h3>
Stredoškolská odborná činnosť <br> <br>
Prekonaj sám seba a ukáž, že máš talent...
</h3>
<p class="read">ČÍTAŤ VIAC</p>
</div>
</div>
</div>
</article>
Thanks in advance
Use display:flex; on the parent element and they will be aligned in one row. You will need no more CSS.
CSS:
.subarticle{
display:flex;
}
Codepen Link: https://codepen.io/emmeiWhite/pen/YzGjOgP
FULL CODE SNIPPET:
.subarticle{
display:flex;
}
<article>
<div class="subarticle">
<div class="wrapper">
<img src="img/logo2.jpg" alt="logo s textom good idea" class="goodidea">
<div class="informacie">
<h2 class="SOČ">SOČ</h2>
<p class="datum"><i class="far fa-calendar-times"></i>6.1.2021</p>
<h3>
Stredoškolská odborná činnosť <br> <br>
Prekonaj sám seba a ukáž, že máš talent...
</h3>
<p class="read">ČÍTAŤ VIAC</p>
</div>
</div>
<div class="wrapper">
<img src="img/logo2.jpg" alt="logo s textom good idea" class="goodidea">
<div class="informacie">
<h2 class="SOČ">SOČ</h2>
<p class="datum"><i class="far fa-calendar-times"></i>6.1.2021</p>
<h3>
Stredoškolská odborná činnosť <br> <br>
Prekonaj sám seba a ukáž, že máš talent...
</h3>
<p class="read">ČÍTAŤ VIAC</p>
</div>
</div>
</div>
</article>

Changing line height without affecting the background color

I'm currently working on freecodecamp's first test, so my question is probably dumb. I would like to change the line-height of #titles to a smaller one, while keeping it's background color. It's probably the display element, but I can't figure out what to do. Also, I'd like to get rid of the white line surrounding my image, right before the border...
<div id="main">
<div id="titles">
<h1 id="title">A tribute to Ocelote</h1>
<h2 id="title2">The man who has done it all.</h2>
</div>
<hr>
<div id="img-div">
<img id="image" src="https://theshotcaller.net/wp-content/uploads/2017/09/IMG_5488-1.jpg" alt="A photo of Ocelote">
<div id="img-caption"> A story of how far can one go, if only the desire is
there.
</div>
<div id="tribute-info">
<br>
<br>
fgj
</div>
<a id="tribute-link" href="https://lol.gamepedia.com/Ocelote" target="_blank"> </a>
</div>
</div>
https://jsfiddle.net/deffciu/hrna0Lfs/
any help is appreciated
Adding the below two rules to #titles makes it work:
#titles {
display: block;
background: #6C7E95;
line-height: 5px;
/* Add the below two rules */
overflow: hidden;
padding: 0 0 20px;
}
You get this:
Snippet
html, body {
font-family: 'Oswald', sans-serif;
text-align: center;
background: white;
}
#title2 {
color: #052449;
margin-bottom: 0px;
}
#titles {
display: block;
background: #6C7E95;
line-height: 5px;
/* Add the below two rules */
overflow: hidden;
padding: 0 0 20px;
}
#image {
border: 8px solid #052449;
border-radius: 50%;
width: 500px;
height: 375px;
margin-top: 15px;
}
hr {
border-color: #486282;
margin-top:0px;
}
#img-caption {
margin-top: 20px;
font-style: italic;
font-size: 25px;;
}
<script src="https://cdn.freecodecamp.org/testable-projects-fcc/v1/bundle.js"></script>
<link href="https://fonts.googleapis.com/css?family=Oswald" rel="stylesheet">
<div id="main">
<div id="titles">
<h1 id="title">A tribute to Ocelote</h1>
<h2 id="title2">The man who has done it all.</h2>
</div>
<hr>
<div id="img-div">
<img id="image" src="https://theshotcaller.net/wp-content/uploads/2017/09/IMG_5488-1.jpg" alt="A photo of Ocelote">
<div id="img-caption"> A story of how far can one go, if only the desire is there.
</div>
<div id="tribute-info">
<br>
<br>
fgj
</div>
<a id="tribute-link" href="https://lol.gamepedia.com/Ocelote" target="_blank"> </a>
</div>
</div>
For the white border issue, it's your body's margins. The below code will fix it.
body {margin: 0;}

Padding/Margin appearing where there shouldn't be any in a 3 column layout

I am trying to create a 3 column layout for a website design that contains an image at the top of each column followed by a h3 then some text. I have done this in the html but when I get to the CSS there are padding/margin coming from somewhere even when I set them both to 0.
Also for some reason the columns aren't aligned vertically correctly?
HTML:
<h3>Why You Should Choose Us For Financing Options.</h3>
<div class="card">
<img src="Heart.png" alt="Heart">
<h5>Lowest Industry Rates</h5>
<p>We take pride in our rates being the lowest in the industry!</p>
</div>
<div class="card">
<img src="Coin.png" alt="Coin">
<h5>Our Funding Is Fast</h5>
<p>After completing our form, you can expect to receive your funding within 48 hours!</p>
</div>
<div class="card">
<img src="File.png" alt="File">
<h5>We're Quick And Easy</h5>
<p>The form is easy to understand and can be completed in minutes!</p>
</div>
CSS:
header h3 {
font-family: 'Montserrat Light', sans-serif;
font-size: 25px;
color: #FFF;
margin-top: 60px;
}
.card {
display: inline-block;
width: 260px;
margin: 0;
padding: 0;
vertical-align: middle;
margin-top: 60px;
}
Image of desired outcome: https://i.gyazo.com/f4a2ef3a9680a1ee79eaafd889d368b7.png
Current outcome:
https://i.gyazo.com/fd2eafc6a980527a07811e409a9262bd.png
How about try this:
HTML:
<h3>Why You Should Choose Us For Financing Options.</h3>
<div id="fc">
<div class="card">
<img src="Heart.png" alt="Heart">
<h5>Lowest Industry Rates</h5>
<p>We take pride in our rates being the lowest in the industry!</p>
</div>
<div class="card">
<img src="Coin.png" alt="Coin">
<h5>Our Funding Is Fast</h5>
<p>After completing our form, you can expect to receive your funding within 48 hours!</p>
</div>
<div class="card">
<img src="File.png" alt="File">
<h5>We're Quick And Easy</h5>
<p>The form is easy to understand and can be completed in minutes!</p>
</div>
</div>
CSS:
header h3 {
font-family: 'Montserrat Light', sans-serif;
font-size: 25px;
color: #FFF;
margin-top: 60px;
}
#fc {
display: flex;
flex-flow: row nowrap;
justify-content: space-between;
}
.card {
display: inline-block;
min-width: 260px;
margin: 0;
padding: 0;
vertical-align: middle;
margin-top: 60px;
}

Timeline, using css and bootstrap 3

I created a timeline using bootstrap and css, but on the last point I don't want the timeline to continue but the line is appearing. could someone show me how I can get rid of it please? Thanks
.timeline {
list-style: none;
padding: 0;
position: relative
}
.timeline:before {
top: 0;
bottom: 0;
position: absolute;
content: "";
width: 2px;
background-color: #000;
left: 40px;
margin-left: -1.5px
}
.timeline>li {
margin-bottom: 50px;
position: relative;
min-height: 50px
}
.timeline>li:before,
.timeline>li:after {
content: " ";
display: table
}
.timeline>li:after {
clear: both
}
.timeline>li .timeline-panel {
width: 100%;
float: right;
padding: 0 20px 0 100px;
position: relative;
text-align: left
}
.timeline>li .timeline-panel:before {
border-left-width: 0;
border-right-width: 15px;
left: -15px;
right: auto
}
.timeline>li .timeline-panel:after {
border-left-width: 0;
border-right-width: 14px;
left: -14px;
right: auto
}
.timeline>li .timeline-image {
left: 0;
margin-left: 0;
width: 80px;
height: 80px;
position: absolute;
z-index: 100;
background-color: #343434;
color: #fff;
border-radius: 100%;
border: 7px solid #f1f1f1;
text-align: center
}
.timeline>li .timeline-image h4 {
font-size: 10px;
margin-top: 12px;
line-height: 14px
}
.timeline>li.timeline-inverted>.timeline-panel {
float: right;
text-align: left;
padding: 0 20px 0 100px
}
.timeline>li.timeline-inverted>.timeline-panel:before {
border-left-width: 0;
border-right-width: 15px;
left: -15px;
right: auto
}
.timeline>li.timeline-inverted>.timeline-panel:after {
border-left-width: 0;
border-right-width: 14px;
left: -14px;
right: auto
}
.timeline>li:last-child {
margin-bottom: 0
}
.timeline .timeline-heading h4 {
margin-top: 0;
}
.timeline .timeline-heading h4.subheading {
text-transform: none
}
.timeline .timeline-body>p,
.timeline .timeline-body>ul {
margin-bottom: 0
}
#media (min-width:768px) {
.timeline:before {
left: 50%
}
.timeline>li {
margin-bottom: 100px;
min-height: 100px
}
.timeline>li .timeline-panel {
width: 41%;
float: left;
padding: 0 20px 20px 30px;
text-align: right
}
.timeline>li .timeline-image {
width: 100px;
height: 100px;
left: 50%;
margin-left: -50px
}
.timeline>li .timeline-image h4 {
font-size: 13px;
margin-top: 16px;
line-height: 18px
}
.timeline>li.timeline-inverted>.timeline-panel {
float: right;
text-align: left;
padding: 0 30px 20px 20px
}
}
#media (min-width:992px) {
.timeline>li {
min-height: 150px
}
.timeline>li .timeline-panel {
padding: 0 20px 20px
}
.timeline>li .timeline-image {
width: 150px;
height: 150px;
margin-left: -75px
}
.timeline>li .timeline-image h4 {
font-size: 18px;
margin-top: 30px;
line-height: 26px
}
.timeline>li.timeline-inverted>.timeline-panel {
padding: 0 20px 20px
}
}
#media (min-width:1200px) {
.timeline>li {
min-height: 170px
}
.timeline>li .timeline-panel {
padding: 0 20px 20px 100px
}
.timeline>li .timeline-image {
width: 170px;
height: 170px;
margin-left: -85px
}
.timeline>li .timeline-image h4 {
margin-top: 40px
}
.timeline>li.timeline-inverted>.timeline-panel {
padding: 0 100px 20px 20px
}
}
<section class="section bg-gray" id="about">
<div class="container">
<div class="row">
<div class="col-lg-12 text-center">
<h2 class="section-heading zoomIn animated wow" data-wow-delay=".1s">About</h2>
<h3 class="section-subheading text-muted fadeIn animated wow" data-wow-delay=".2s">Our journey to sucsses with your business.</h3>
</div>
</div>
<div class="row">
<div class="col-lg-12">
<ul class="timeline">
<li>
<div class="timeline-image">
<img class="img-circle img-responsive" src="img/3.jpg" alt="">
</div>
<div class="timeline-panel fadeInLeft animated wow" data-wow-delay=".3s">
<div class="timeline-heading">
<h4 class="subheading">Th power of social media</h4>
</div>
<div class="timeline-body">
<p class="text-muted">Imagine the ability for your business to take on a personality of its own, actually talking and engaging with people, even making them laugh. Imagine your business identifying its own opportunities, increasing sales and building relationships with 1000’s of potential customers. Done correctly, that's exactly what Social Media Marketing provides. People buy off people and Social Media is the perfect way to huminise your brand, gain exposure like never before perfect way to huminise your brand, gain exposure like never before and target the right adverts, to the right people, at the right time, in a way they will literally “like”. There are several components needed for your business to go from A to B and maximise its efforts when using Social Media as a marketing vessal… This document will highlight the journey and explain how Ice7Media can offer the shortest route to Social Media Marketing success. </p>
</div>
</div>
</li>
<li class="timeline-inverted">
<div class="timeline-image">
<img class="img-circle img-responsive" src="img/3.jpg" alt="">
</div>
<div class="timeline-panel fadeInRight animated wow" data-wow-delay=".4s">
<div class="timeline-heading">
<h4 class="subheading">getting ready for take off: The Set-up</h4>
</div>
<div class="timeline-body">
<p class="text-muted">Each Social Media Platform is different… they look different and the operate differently. The “7” in Ice7Media comes from the fact that we concentrate on the top seven Social Media Platforms. That’s seven business profiles that need to be set up correctly, branded correctly and structured to provide a consistent brand image. Ice7Media’s first port of call is to collect, claim, set up and consolidate your businesses Social Media personas. We completely consolidate your businesses Social Media personas. We completely brand each “profile” with custom design work and ensure that everything is correct and pointing in the right digital direction within each platform. Many business have already entered the Social Media arena but it is extremely rare for all seven profiles to be completed in full and working in tandem. Once these foundations have been laid, your business is ready to start broadcasting</p>
</div>
</div>
</li>
<li>
<div class="timeline-image">
<img class="img-circle img-responsive" src="img/3.jpg" alt="">
</div>
<div class="timeline-panel fadeInLeft animated wow" data-wow-delay=".5s">
<div class="timeline-heading">
<h4 class="subheading">Cruise Control</h4>
</div>
<div class="timeline-body">
<p class="text-muted">Good, consistent content is critical for social media success… your audience needs to connect with your brand and find your social streams entertaining. It is also crucial to not over sell your product or service, or post too many times and spam your audience. Ice7Media provide daily content for over 70 businesses and have a dedicated team working hard to ensure that your business has always got something good to say. By managing your social streams correctly your adverts and sales messages will be naturally boosted because your audience will already be sales messages will be naturally boosted because your audience will already be engaging with your brand and liking your content. This enables your business to reach far and wide and gain exposure to 1000’s of potential customers. </p>
</div>
</div>
</li>
<li class="timeline-inverted">
<div class="timeline-image">
<img class="img-circle img-responsive" src="img/3.jpg" alt="">
</div>
<div class="timeline-panel fadeInRight animated wow" data-wow-delay=".6s">
<div class="timeline-heading">
<h4 class="subheading">Firing your guns!</h4>
</div>
<div class="timeline-body">
<p class="text-muted">As soon as you join a social media site they start to build a picture of who you are… Age, sex, location, interests, hobbies, and frequently visited places… everything you do is logged to create an accurate profile of who you are. For a fee, you can access this information and use it to advertise your product or service to your perfect target audience. Ice7Media develop highly engaging adverts and then target them to a selected audience that match the brands “perfect customer profile”. If your product or service is ideal for women, aged 25 - 35, who like dining out, If your product or service is ideal for women, aged 25 - 35, who like dining out, and live within 5 miles of your postcode… Ice7Media can create an advert that will only be seen by people that match this criteria, furthermore, Ice7Media will structure the advert to literally stand out in a very welcome way that the potential client will find difficult to ignore. Social Media Advertising, done correctly, is a very powerful tool that can offer your business a fantastic R.O.I</p>
</div>
</div>
</li>
<li>
<div class="timeline-image">
<img class="img-circle img-responsive" src="img/3.jpg" alt="">
</div>
<div class="timeline-panel fadeInLeft animated wow" data-wow-delay=".3s">
<div class="timeline-heading">
<h4 class="subheading">Mission control: Ice7Media</h4>
</div>
<div class="timeline-body">
<p class="text-muted"> Ice7Media operate Social Media Marketing campaigns for over 70 business and have the expertise needed to ensure that your business can simply sit back and relax, and have the expertise needed to ensure that your business can simply sit back and relax, safe in the knowledge that your social media activity is working in tandem with your business's goals.</p>
</div>
</div>
</li>
</ul>
</div>
</div>
</div>
</section>
Thanks in advance
Tom
Use .timeline>li:last-child to target the last of the items in the timeline.
Then you can target parts like this (attempting to hide part of the line):
.timeline>li:last-child .timeline-panel:after {
display: none;
}

<hr> Line appearing below relative div

I'm currently creating a website which is created by three main divs on one page. In-between each div, I have a faint hr to help visually 'split them up'.
Between my first and second divs, the hr displays fine.
Between the second and third is my problem - the hr displays underneath the second div. I have a feeling it is to do with the relative positioning of the container of my second div, but that is needed for me to position images within in.
I have tried display:block and wrapping the second div inside another container amongst other things, but nothing has yet worked.
I could try using div with a background/border rather than hr, but i'm not sure if this is the right way to approach it (i'm still learning my way around things).
Below is my code for the 'second div' and the hr I am trying to position.
<!-- PORTFOLIO -->
<div id="portfoliocont">
<div class="smallthumb" id="thumb1">
<a href="media/pamabest/pamabesttitle-large.jpg" class="overlay" data-lightbox="image-1" data-title="Pamabest" class="show">
<a href="media/pamabest/app-login.jpg" class="overlay" data-lightbox="image-1" data-title="Log in with your own account">
<a href="media/pamabest/tutorial.jpg" class="overlay" data-lightbox="image-1" data-title="Message your friends">
<a href="media/pamabest/app-profile.jpg" class="overlay" data-lightbox="image-1" data-title="Create your own profile">
<a href="media/pamabest/app-messages.jpg" class="overlay" data-lightbox="image-1" data-title="Message your friends">
<a href="media/pamabest/karaoke--menu.jpg" class="overlay" data-lightbox="image-1" data-title="Have a laugh">
<a href="media/pamabest/lists-viewlist.jpg" class="overlay" data-lightbox="image-1" data-title="Be prepared">
<a href="media/pamabest/mycar.jpg" class="overlay" data-lightbox="image-1" data-title="See the stats">
<a href="media/pamabest/weather.jpg" class="overlay" data-lightbox="image-1" data-title="Pack wisely">
<a href="media/pamabest/ticket5pariswhitestarstextured.jpg" class="overlay" data-lightbox="image-1" data-title="Front of 'Pamabest: Paris' ticket">
<a href="media/pamabest/ticketbackwhitestarstextured.jpg" class="overlay" data-lightbox="image-1" data-title="Back of 'Pamabest: Paris' ticket">
<a href="media/pamabest/travelticket2withbannertextured.jpg" class="overlay" data-lightbox="image-1" data-title="Front of 'Pamabest: Travel Pass' ticket">
<a href="media/pamabest/travelticket2backtextured.jpg" class="overlay" data-lightbox="image-1" data-title="Front of 'Pamabest: Travel Pass' ticket">
<img src="images/smallthumb/pamabest-small.jpg" alt="Imaginary music festival, Pamabest"/ title="Pamabest companion app">
<h1>"Pamabest" is a European, multi-cultural music festival aimed at 18-30 year olds.<br>A companion app would be used to help festival goers navigate the park and enhance their overall experiance.</h1></a>
<p>Pamabest music festival</p>
</div>
<div class="smallthumb" id="thumb2">
<a href="media/pisforpsychohd.mov" class="overlay">
<img src="images/smallthumb/psycho-small.jpg" alt="2 Minute video recreating a scene from the move, P is for Psycho" title="P is for Psycho video"/>
<h1>Filmed within a group, the video is a recreation of the 'bathroom scene' from the movie. <br>All editing was made in Premier Pro.</h1></a>
<p>P is for Pscyho</p>
</div>
<div class="smallthumb" id="thumb3">
<a href="media/silverlake/build/index.html" class="overlay" target="_blank">
<img src="images/smallthumb/silverlake-small.jpg" alt="Silverlake Website" title="Silverlake theme park website"/>
<h1>Silverlake theme park is based in the heart of Yorkshire, boasting a zoo and other child-friendly features. <br> The website was made with HTML5 and CSS3, graphical assests were made in Photoshop and Illustrator.</h1></a>
<p>Silverlake themepark</p>
</div>
<div class="blankthumb" id="thumb4"></div>
<div class="blankthumb" id="thumb5"></div>
<div class="blankthumb" id="thumb6"></div>
</div>
<hr>
And my CSS
hr {
margin: 40px 0px;
border: none;
height: 1px;
color: #ececec; /* old IE */
background-color: #ececec; /* Modern Browsers */
}
/* PORTFOLIO
--------------------------*/
#portfoliocont {
position: relative;
margin-bottom: 40px;
display: block;
}
.smallthumb, .blankthumb {
display: inline-block;
position: absolute;
}
.smallthumb a {
text-decoration: none;
}
.smallthumb img {
-webkit-box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.23);
-moz-box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.23);
box-shadow: 0px 0px 3px 1px rgba(0,0,0,0.23);
}
.blankthumb {
background: #f2f2f2;
width: 296px;
height: 174px;
}
#thumb1 {
left: 0px;
top: 0px;
}
#thumb2 {
left: 335px;
top: 0px;
}
#thumb3 {
right: 0px;
top: 0px;
}
#thumb4 {
left: 335px;
top: 250px;
}
#thumb5 {
right: 0px;
top: 250px;
}
#thumb6 {
left: 0px;
top: 250px;
}
#portfoliocont p {
padding-top: 10px;
color: #808080;
font-weight: 400;
}
.overlay h1 {
position: absolute;
/*display: inline-block;*/
height: 164px;
width: 276px;
bottom: 0;
top: 0;
color: white;
background-color: #806d9e;
opacity: 0;
font: 1em "Helvetica Neue";
text-align: left;
padding: 10px 10px 0px 10px;
line-height: 1.4em;
transition: transform 0.3s, opacity 0.3s;
-ms-transition: -ms-transform 0.3s, opacity 0.3s;
-webkit-transition: -webkit-transform 0.3s, opacity 0.3s;
}
.overlay h1 br{
display: block;
line-height: 2em;
}
.overlay:hover h1{
opacity: 1;
}
#thumb1 a.show {
display: block;
}
#thumb1 a {
display: hidden;
}
Thanks
Your problem here is all the thumbs with position: absolute;
When the browser renders an element with position: absolute; it doesn't take any space.
In your case, the #portfoliocont "has nothing inside".. What I mean is that anything inside that div occupies any space. Therefore, it's height is zero.
Following your zero-height div, the browser continues to render the <hr /> tag.
I strongly recommend not to position your thumbs absolutely. You have many other options, such as:
Display inline-block
Float left
Flexbox (watch out for browser support on this one)
Here is a simple example of using inline-block for the thumbs: https://jsfiddle.net/Lfhctqkg/
Defining div height, solved this little problem for me. An easier way, at least for a student on a simple task.