As in the snippet, I'm implementing intersection observer to change the background image when the specific section comes in middle of the .main section.
The problem is the .main section is affecting all the divs of the page because its .BG inside main has fixed position.
Is there a way to fix this or i can stop the the user on main section till last child than i scroll to footer ?
const bgEl = document.querySelector(".BG");
const bgE2 = document.querySelector(".section");
function createObserver(el) {
let observer;
let options = {
root: null,
rootMargin: "0px",
};
function handleIntersect(entries, observer) {
entries.forEach((entry) => {
if (entry.isIntersecting) {
const url = entry.target.getAttribute("BGurl");
bgEl.style.backgroundImage = `url(${url})`;
entry.target.classList.add("visible");
} else {
entry.target.classList.remove("visible");
}
});
}
observer = new IntersectionObserver(handleIntersect, options);
observer.observe(el);
return observer;
}
(function () {
const sections = document.querySelectorAll(".main .section");
const observers = Array.from(sections).map(function (section) {
createObserver(section);
});
})();
* {
margin: 0px;
padding: 0px;
}
.section {
height: 100vh;
width: 100%;
display: flex;
z-index: 1;
position: relative;
background-size: 100% 100% !important;
opacity: 0.4;
}
.visible {
opacity: 1;
transition: all 1s ease-in-out;
}
.text {
margin: auto;
}
.text p {
font-family: "Lato";
font-style: normal;
font-weight: 500;
font-size: 18px;
line-height: 149%;
color: #263244;
}
.text h1 {
margin-bottom: 20px;
font-family: "Lato";
font-style: normal;
font-weight: 700;
font-size: 50px;
line-height: 0px;
color: #ffffff;
margin-bottom: 50px;
}
.text .story-detail {
width: 300px;
border-radius: 20px;
background: radial-gradient(
76.31% 191.89% at 13.43% 22.19%,
rgba(226, 228, 231, 0.8) 0%,
rgba(228, 228, 229, 0.368) 100%
);
backdrop-filter: blur(10px);
padding: 23px;
}
.text .story-description {
width: 321px;
border-radius: 20px;
background: radial-gradient(
76.31% 191.89% at 13.43% 22.19%,
rgba(226, 228, 231, 0.8) 0%,
rgba(228, 228, 229, 0.368) 100%
);
backdrop-filter: blur(10px);
padding: 23px;
}
.BG {
position: fixed;
height: 100%;
width: 100%;
z-index: 0;
opacity: 1;
top: 0px;
background-size: cover;
background-repeat: no-repeat;
opacity: 1;
}
.main {
width: 100%;
height: 100vh;
}
<div style="height: 700px; width: 100%">
Header
</div>
<div style="height: 700px; width: 100%">
Intro
</div>
<div class="main">
<div class="BG"></div>
<div
class="section"
BGurl="https://i.postimg.cc/9QYL3ytR/mobile-camp.png"
>
<div class="text">
<div style="margin-inline: 20px">
<h1>Our Story</h1>
<div class="story-detail">
<p>
We saw a gap between what people need and what banks offer. It
means millions of us aren't getting the banking experience we
deserve for different reasons.
</p>
</div>
</div>
</div>
</div>
<div
class="section"
BGurl="https://i.postimg.cc/9QYL3ytR/mobile-camp.png"
>
<div class="text">
<div style="margin-inline: 20px">
<div class="story-description">
<p>
Traditional banks don’t focus on customers' experience, their
systems may be slow and outdated, they may prioritize a specific
group of people, or perhaps they lack the ability to innovate,
and so on.
</p>
</div>
</div>
</div>
</div>
<div
class="section"
BGurl="https://i.postimg.cc/9QYL3ytR/mobile-camp.png"
>
<div class="text">
<div style="margin-inline: 20px">
<div class="story-description">
<p>
Traditional banks don’t focus on customers' experience, their
systems may be slow and outdated, they may prioritize a specific
group of people, or perhaps they lack the ability to innovate,
and so on.
</p>
</div>
</div>
</div>
</div>
<div
class="section"
BGurl="https://i.postimg.cc/cLPLS8xW/mobile-desert.png"
>
<div class="text">
<div style="margin-inline: 20px">
<div class="story-description">
<p>
So since we're passionate about solving problems and bridging
gaps, we looked into and identified the challenges and
capabilities we'll need to build a bank here in the Kingdom.
</p>
</div>
</div>
</div>
</div>
<div
class="section"
BGurl="https://i.postimg.cc/mZnqV38T/mobile-birds.png"
>
<div class="text">
<div style="margin-inline: 20px">
<div class="story-description">
<p>
With the best local and international expertise, we began
building an innovative digital bank designed by and for the
people. We believe that the most effective way to build a bank
for people is to do it with them. This is our philosophy. So, we
started building it with the help of people like you.
</p>
</div>
</div>
</div>
</div>
<div class="section" BGurl="https://i.postimg.cc/k513m0Fb/mountain.png">
<div class="text">
<div style="margin-inline: 20px">
<div class="story-description">
<p>
At D360, innovation starts with someone’s passion for improving
financial services. To that person, we say: Never stop offering
solutions to your needs. These solutions will not only benefit
you, but will significantly impact the lives of millions.
</p>
</div>
</div>
</div>
</div>
</div>
<div style="height: 700px; width: 100%">
Links here
</div>
<div style="height: 100vh; width: 100%">
Footer here
</div>
Related
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
I'm trying to resize the image size to the same size as the content of the text. However, when I try using solutions such as flex, the images are grayed out. Does anyone know any other way of achieving this? Or if I am doing something wrong. The Code is below, both html and Css, the website this is on is: on this page here . Any help would be much appreciated.
/* Create two equal columns that floats next to each other */
.column {
float: left;
width: 50%;
padding: 0px;
overflow: auto;
height: 300px; /* Should be removed. Only for demonstration */
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
background-color: black;
}
.row{
padding: 0.5% 1%;
}
.textcont{
background-color: black;
padding: 1.5%;
width: 100%;
overflow: auto;
height: 300px;
position: relative;
/*overflow: hidden;*/
}
.textcont > h1 {
margin: 0;
color: white;
text-shadow: 0 1px 0 white;
}
.imgcont{
background:
linear-gradient(
to right,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 5)
),
url('https://jackdaly.github.io/images/drawing (6).jpg');
background-repeat: no-repeat;
background-size: cover;
background-position: center;
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
}
.buttonproj {
background-color: transparent;
color: white;
align-content: center;
padding: 1%;
border: 3px solid white;
}
.buttonproj:hover {
background-color: #555555;
color: white;
}
<h2 class="w3-center" style="padding-bottom: 2%">Portfolio</h2>
<div class="row">
<!-- ##### -->
<div class="column" style="background-color:#aaa;">
<div class="imgcont" style="background-image:linear-gradient(
to right,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 5)
), url('./images/fishtankcover.png')"></div>
</div>
<div class="column" style="">
<div class="textcont" style="" align="right">
<h1>Smart Tank </h1>
<p style="color: aliceblue">It can be a daunting experience for people buying, setting up and maintaining (or even thinking about) a fish tank and if they have the time needed for this hobby to keep their new friends alive. The AAS, short for Automatic Aquarium System (known as Smart Tank now), is a work in progress project that aims to be the step ladder for new users to climb with ease over the learning wall. The Smart Tank takes care of everything needed to take care of a fully planted aquarium.</p>
<div align="right" padding="1% 10%">
<button class="buttonproj" >Find Out More</button>
</div>
</div>
</div>
<!-- ##### -->
<div class="column" style="">
<div class="textcont" style="" align="left">
<h1>CNC Dust Shoe </h1>
<p style="color: aliceblue">CNC Dust shoes are incredibly important when milling any material, especially materials that can be toxic or bad for the user's health. With this project, I aimed to combine functionality with aesthetics to create a highly functional product that looks aesthetically pleasing. The project was designed in Fusion 360 and showcases how highly functional tools can also take on pleasing form. The shoe can be moved up and down, adjusted with ease and the hoover extension can be removed for different additions.</p>
<div align="left" padding="1% 10%">
<button class="buttonproj" >Find Out More</button>
</div>
</div>
</div>
<div class="column" style="background-color:#aaa;">
<div class="imgcont" style="background-image:linear-gradient(
to left,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 1)
), url('https://jackdaly.github.io/images/cncshoe (3).png') "></div>
</div>
<!-- ##### -->
</div>
Is this what you are looking for? It looks like the path to the image was relative. I've put in the absolute path.
/* Create two equal columns that floats next to each other */
.column {
float: left;
width: 50%;
padding: 0px;
overflow: auto;
height: 300px; /* Should be removed. Only for demonstration */
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
background-color: black;
}
.row{
padding: 0.5% 1%;
}
.textcont{
background-color: black;
padding: 1.5%;
width: 100%;
overflow: auto;
height: 300px;
position: relative;
/*overflow: hidden;*/
}
.textcont > h1 {
margin: 0;
color: white;
text-shadow: 0 1px 0 white;
}
.imgcont{
background:
linear-gradient(
to right,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 5)
),
url('https://jackdaly.github.io/images/drawing (6).jpg');
background-repeat: no-repeat;
background-size: cover;
background-position: center;
width: 100%;
height: 100%;
position: relative;
overflow: hidden;
}
.buttonproj {
background-color: transparent;
color: white;
align-content: center;
padding: 1%;
border: 3px solid white;
}
.buttonproj:hover {
background-color: #555555;
color: white;
}
<h2 class="w3-center" style="padding-bottom: 2%">Portfolio</h2>
<div class="row">
<!-- ##### -->
<div class="column" style="background-color:#aaa;">
<div class="imgcont" style="background-image:linear-gradient(
to right,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 5)
), url('https://jackdaly.github.io/images/fishtankcover.png')"></div>
</div>
<div class="column" style="">
<div class="textcont" style="" align="right">
<h1>Smart Tank </h1>
<p style="color: aliceblue">It can be a daunting experience for people buying, setting up and maintaining (or even thinking about) a fish tank and if they have the time needed for this hobby to keep their new friends alive. The AAS, short for Automatic Aquarium System (known as Smart Tank now), is a work in progress project that aims to be the step ladder for new users to climb with ease over the learning wall. The Smart Tank takes care of everything needed to take care of a fully planted aquarium.</p>
<div align="right" padding="1% 10%">
<button class="buttonproj" >Find Out More</button>
</div>
</div>
</div>
<!-- ##### -->
<div class="column" style="">
<div class="textcont" style="" align="left">
<h1>CNC Dust Shoe </h1>
<p style="color: aliceblue">CNC Dust shoes are incredibly important when milling any material, especially materials that can be toxic or bad for the user's health. With this project, I aimed to combine functionality with aesthetics to create a highly functional product that looks aesthetically pleasing. The project was designed in Fusion 360 and showcases how highly functional tools can also take on pleasing form. The shoe can be moved up and down, adjusted with ease and the hoover extension can be removed for different additions.</p>
<div align="left" padding="1% 10%">
<button class="buttonproj" >Find Out More</button>
</div>
</div>
</div>
<div class="column" style="background-color:#aaa;">
<div class="imgcont" style="background-image:linear-gradient(
to left,
rgba(0, 0, 0, 0),
rgba(0, 0, 0, 1)
), url('https://jackdaly.github.io/images/cncshoe (3).png') "> </div>
</div>
<!-- ##### -->
</div>
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;}
I am creating a messaging system where one user speaks to the other. I have created message boxes with the arrows. So far all the boxes has arrows except one (see pics below). Also the height is not auto adjusting to the content. Can someone take a look at my code to see what is going on?
HTML
<div class="col-xs-7 live-chat-feed">
<div class="chat-date"><p>Friday 12:34</p></div>
<div class="user-post">
<div class="chat-avatar">
<img src="img/bitmap(3).png"
srcset="img/bitmap(3)#2x.png 2x,
img/bitmap(3)#3x.png 3x"
class="Bitmap"><p class="time-posted">12:47</p>
</div>
<div class="single-post-box">
<p class="chat-content">
Hey there! <br>
I noticed that not only are you a football fan
but you also go to a lot of games! What do you think about the upcoming season and who is your favorite team? Looks to me like you are a Pats fan!</p>
</div>
</div>
<div class="new-live-chat">
<div class="chat-date"><p>Saturday 22:40</p></div>
<div id="current-user">
<div class="user-post">
<div class="chat-avatar">
<img src="img/bitmap-copy.png"
srcset="img/bitmap-copy#2x.png 2x,
img/bitmap-copy#3x.png 3x"
class="Bitmap"><p class="time-posted">12:47</p>
</div>
<div class="single-post-box">
<p class="chat-content">
Wow! That’s awesome. I love football and im a beat writer for the Pats & have the luxury of catching their games!</p>
</div>
<div class="single-post-box">
<p class="chat-content">
What about you? Are you a Pats fan yourself?</p>
</div>
</div>
</div>
<div class="user-post">
<div class="chat-avatar">
<img src="img/bitmap(3).png"
srcset="img/bitmap(3)#2x.png 2x,
img/bitmap(3)#3x.png 3x"
class="Bitmap"><p class="time-posted">12:47</p>
</div>
<div class="single-post-box">
<p class="chat-content">
Oh yeah! Brady with the SB win again this year! </p>
</div>
</div>
<div id="current-user">
<div class="user-post">
<div class="chat-avatar">
<img src="img/bitmap-copy.png"
srcset="img/bitmap-copy#2x.png 2x,
img/bitmap-copy#3x.png 3x"
class="Bitmap"><p class="time-posted">12:47</p>
</div>
<div class="single-post-box">
<p class="chat-content">
Thats pretty cool! No idea how much of a Pats fan you were to already have season tix! I dont even have them yet!</p>
</div>
</div>
</div>
</div>
CSS
.live-chat-feed {
margin-left: 50%;
margin-top: -310%;
background-color: #000;
}
.new-live-chat {
margin-top: 20%;
}
.chat-avatar {
position: relative;
left: -30%;
top: 85px;
}
.chat-date,
.chat-content,
.time-posted {
color: #8785ab;
}
.chat-date {
position: relative;
left: 30%;
}
.single-post-box {
width: 729.9px;
height: auto;
border-radius: 2px;
background-color: #ffffff;
box-shadow: 0 2px 4px 0 rgba(167, 169, 197, 0.55);
margin-bottom: 10%;
padding: 20px;
}
#current-user .single-post-box {
position: relative;
left: -15%;
border-radius: 2px;
background-color: #1ac384;
box-shadow: 0 2px 4px 0 rgba(167, 169, 197, 0.55);
}
.single-post-box::after {
content: '';
height: 0;
position: absolute;
width: 0;
border: 10px solid transparent;
border-right-color: #fff;
right: 97.5%;
top: 115px;
}
#current-user .single-post-box::after {
content: '';
height: 0;
position: absolute;
width: 0;
border: 10px solid transparent;
border-left-color: #1ac384;
left: 100%;
top: 0px;
}
I always use height: inherit; for height property. It will create a box containing the the text without any free space at the bottom. So if you have like text of 3 rows it will create a height like 20% or something, if you have 6 rows, it will create height of 40%, etc. Hope that helps.
See page (front.html)
Codepen
What the page should look like (Ignore the div highlighting, its structure is not being used)
No matter what or how I try, the "Read More" image (line 61) refuses to center horizontally AND responsively. As in, it's responding to pixel measurements, but not % measurements.
I've looked at around 15 articles by now, and I can't afford to spend any more time fruitlessly. Does anyone have a solution to the fact that the Read More image refuses to center? It should be responsive too. The only reason I can think of as to why it's not centering is because of bootstrap, but I doubt that.
The image is currently in a link tag inside a div that class="read-more". The image seems to ignore the margin-left and margin-right properties entirely.
.read-more img{
display:inline-block;
padding-left:auto;
margin-right:auto;
height:10%;
width:20%;
}
An image should not be centered using the approach you are using. Simply add:
text-align:center;
To the block level container element's CSS rule (not the image's CSS rule).
Text alignment is an inherited CSS property and you use it by applying it to the parent BLOCK LEVEL element (container) of the element that needs alignment. In your case, since you have the image inside of a div, the CSS rule should be applied to the div.
A width of 100% for the container and text-align:center should do:
.read-more img {
height: 10%;
width: 20%;
}
.read-more {
width: 100%;
text-align: center;
}
Updated codepen: http://codepen.io/anon/pen/EKmmMZ
You can apply text-align: center to read-more div to make image to center. Make Sure that the link and image must not have float property used.
Here is the code you exactly need.
Updated codepen: http://codepen.io/anuragscsit/pen/YqVVmv
body {
background-image: url("graphics/Website_background_2,_100_dpi.jpg");
}
body a {
color: rgb(241, 90, 34);
}
body a:hover {
color: rgb(208, 78, 29);
}
body a:visited {
color: rgb(144, 14, 0);
}
.row {
overflow: hidden;
}
[class*="xs-"] {
margin-bottom: -99999px;
padding-bottom: 99999px;
background-color: rgba(255, 255, 255, 0.8);
padding-top: 40px;
}
.row1-imgs img {
height: 60%;
width: 100%;
/*box-shadow: inset 5px 5px 7px rgb(0,256,0);/*the line that breaks .border-blue and .border-orange shadows*/
}
.read-more{text-align:center;}
.read-more img {
display: inline-block;
padding-left: auto;
margin-right: auto;
height: 10%;
width: 20%;
}
.read-more div {
background-color: green;
margin-left: 20px;
}
.row1 p {
text-align: justify;
margin-top: 20px;
padding-left: 15px;
padding-right: 15px;
}
.row2 {
text-align: center;
}
#row3 img {
height: 60%;
width: 100%;
}
[class*="title-"] {
text-shadow: 4px 4px 5px rgb(63, 63, 63);
font-weight: bold;
color: white;
font-family: Serif;
letter-spacing: 2px;
font-size: 130%;
text-align: center;
}
.title-blue,
.blue-border,
.title-orange,
.orange-border {
box-shadow: 5px 5px 7px rgb(117, 117, 117);
}
.title-blue {
background-color: rgb(0, 102, 179);
}
.title-orange {
background-color: rgb(208, 78, 29);
}
.blue-border {
border: 4px solid rgb(0, 102, 179);
}
.orange-border {
border: 4px solid rgb(208, 78, 29);
}
#post1 {
width: 85%;
margin-left: auto;
margin-right: auto;
}
#post1 p {
text-align: justify;
}
#post2 {
width: 50%;
margin-left: auto;
margin-right: auto;
}
.event {
padding-top: 3%;
}
.event p {
font-size: 110%;
}
.eventitle {
font-size: 120%;
font-weight: bold;
}
#post1 .eventitle {
color: rgb(0, 102, 179);
}
#post2 .eventitle {
color: rgb(208, 78, 29);
}
* {
/*border: 1px dotted green;*/
}
/*line 13-21 taken from http://stackoverflow.com/questions/19695784/how-can-i-make-bootstrap-columns-all-the-same-height
*/
<html lang="en">
<head>
<link rel="stylesheet" href="front.css" />
<meta name="" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css" integrity="sha384-1q8mTJOASx8j1Au+a5WDVnPi2lkFfwwEAa8hDDdjZlpLegxhjVME1fgjWPGmkzs7" crossorigin="anonymous">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="assets/css/bootstrap-responsive.css" rel="stylesheet">
<link rel="icon" href="graphics/Liger head for website masthead.ico" />
<title>Ligerbots</title>
</head>
<body>
<header>
</header>
<nav class="navbar navbar-inverse navbar-fixed-top" role="navigation">
<div class="container-fluid">
<!-- Brand and toggle get grouped for better mobile display...Ross you decide whether this is important or not -->
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="http://sonexdjco.com/" target="_blank">
<img id="brand-image" src="img/bg9.png" alt="Check us out!">
</a>
</div>
<!-- Collect the nav links-->
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="https://www.google.com/maps/dir//MONROE+Restaurant,+450+Massachusetts+Avenue,+Cambridge,+MA+02139/#42.3751756,-71.1304011,10.44z/data=!4m9!4m8!1m0!1m5!1m1!1s0x89e37754659a60b7:0xdf11b00d94f15ff9!2m2!1d-71.1012446!2d42.36351!3e0?hl=en-US"
target="_blank">Get Directions!<span class="sr-only">(current)</span></a></li>
<li><a href="https://sonexdjco.yapsody.com/event/index/34100/spring-fever" target=_blank>Buy Tickets!</a></li>
<li>Overview</li>
<li>Links</li>
<li>Map</li>
</ul>
</div>
</div>
</nav>
<div class="container-fluid">
<div class="row">
<div style="background-color:rgba(255,255,255,0.8)" class="col-xs-5 col-xs-offset-1">
<div>
<div class="row1">
<div class="title-orange">
LIGERBUILD BLOG
</div>
<span class="row1-imgs"><img class="orange-border" src="graphics/row1col1.gif"/></span>
<p>Work has already begun on the chassis for the 2016 Stronghold robot. Five working groups are preparing the team to hit the ground running on January 9. We have students working on mechanical, electrical, programming and several fixing the road
kill. . . .</p>
</div>
<div>
</div>
</div>
</div>
<div class="col-xs-5">
<div class="row1">
<div class="title-blue">
LIGERBUISNESS BLOG
</div>
<span class="row1-imgs"><img class="blue-border" src="graphics/row1col2.jpg"/></span>
<p>FRC alumnus Ian from Dash Electric visited with his awesome electric longboard in December and told us how he started his company. Students got to ride his board and ask him lots of questions. <a>Read and see more. . .</a></p>
</div>
</div>
</div>
</div>
<div class="read-more">
<img src="graphics/Read_more_button_outlines.gif" />
</div>
<div class="row">
<div style="background-color:rgba(255,255,255,0.8);" class="col-xs-5 col-xs-offset-1">
<div class="row2">
<div class="title-blue">
ANNOUNCMENTS
</div>
<div style="background-color:rgba(255,255,255,0.8)" class="blue-border">
<div id="post1">
<div class="event">
<span class="eventitle">Team Dinners Needed During Build</span>
<p>Please sign up to make team dinners during build season. We eat together as a team on Friday nights at 6:00. Several families can do this together. Please see the signup here.
</div>
<div class="event">
<span class="eventitle">Carpool Drivers Needed</span>
<p>Please sign up to drive carpools from North to South and back, Mondays through Saturdays during build season. Please see details on our carpool page, here.</p>
</div>
<div class="event">
<span class="eventitle">STIMMS Signup Required</span>
<p>All Students must sign up on STIMMS or theey will not be able to attend competitions. Please see details here.</p>
</div>
<div class="event">
<span class="eventitle">No Team Meeting 12/24</span>
<p>There will be no team meeting 12/24 due to Christmas. Team meetings will resume on 1/4/16.</p>
</div>
</div>
</div>
</div>
</div>
<div class="col-xs-5">
<div class="row2">
<div class="title-orange">
UPCOMING EVENTS
</div>
<div style="background-color:rgba(255,255,255,0.8)" class="orange-border">
<div id="post2">
<div class="event">
<span class="eventitle">Visit the Waban Cub Scouts</span>
<p>January 13, 2016, 7-8 p.m.<br/> Waban Library Center</p>
</div>
<div class="event">
<span class="eventitle">Visit to Danger Awesome!</span>
<p>January 23, 2016, 4-6 p.m.<br/> 215 Ranham St. Melrose, MA</p>
</div>
<div class="event">
<span class="eventitle">Whole Foods Fundraiser</span>
<p>Feb. 1-28 10 a.m.-10 p.m.<br/> Whole Foods, Newton Four Corners</p>
</div>
<div class="event">
<span class="eventitle">FRC Competition at WPI</span>
<p>March 11-12, 2016, 9 a.m.-5 p.m.<br/> Worcester Polytechnic Institute<br/> Link to FIRST Livestream here</p>
</div>
<br/>
<br/>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-xs-10 col-xs-offset-1">
<div id="row3">
<div class="blue-border">
<img src="graphics/row3col1.jpg" />
</div>
</div>
</div>
</div>
</div>
</body>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js" integrity="sha384-0mSbJDEHialfmuBBQP6A4Qrprq5OVfW37PRR3j5ELqxss1yVqOtnepnHVP9aJ7xS" crossorigin="anonymous"></script>
</html>
You need to alter the css line 42 to this
.read-more {
text-align: center;
}
Please use "margin" property to bring it center.It will align the image in order of -Top,Right,Bottom and Left.
.read-more img {
display: inline-block;
float:center;
padding-left: auto;
margin: 0 0 0 40%;
height: 10%;
width: 20%;
}
try this perhaps
.read-more {
margin: 0 20% 0 20%;
}
or any value of percentage that you'd like