How to keep the text align of each other - html

This is the site i'm working on. http://elegantcurtainsandblinds.co.uk/
The text at the top with the icons/images (call us, visit our showroom, Watch our video), I can't seem to keep the text align of each other.
So the text should be within the same line of each other. Everytime I put space in the image/icon moves further to the left.
This is the code -
<div class="topSection">
<div class="logo">
<img src="<?php echo $siteURL;?>/images/eg_logo_new.png" alt="Logo">
</div>
<br>
<p style="float:right;"> Call Us: 01924 724848</p>
<img style="float:right;" src="images/mobile.png"/> <br><br>
<p style="float:right;"> Visit Our Showroom</p>
<img style="float:right;" src="images/images.png" height="30px" width="30px;"/><br><br>
<p style="float:right;"> Watch Our Video</p>
<img style="float:right;" src="images/video.png" height="30px" width="30px;"/>
<div class="clear"></div>
</div>

Use display: flex for modern browsers, it's mush easier to work with. Here is a possible solution for your problem (click on Run code snippet to see the result):
.topSection {
display: flex;
justify-content: space-between;
}
.info-container {
display: flex;
flex-direction: column;
}
.info {
display: flex;
align-items: center;
}
.info img {
margin-right: 8px;
}
<div class="topSection">
<div class="logo">
<img src="http://www.elegantcurtainsandblinds.co.uk/images/eg_logo_new.png" alt="Logo">
</div>
<div class="info-container">
<div class="info">
<img src="http://elegantcurtainsandblinds.co.uk/images/mobile.png" height="30px" width="30px;" />
<p>Call Us: 01924 724848</p>
</div>
<div class="info">
<img src="http://elegantcurtainsandblinds.co.uk/images/images.png" height="30px" width="30px;">
<p>Visit Our Showroom</p>
</div>
<div class="info">
<img src="http://elegantcurtainsandblinds.co.uk/images/video.png" height="30px" width="30px;">
<p>Watch Our Video</p>
</div>
</div>
</div>
More info on flexbox

Related

How do you make a responsive footer like this?

I want to make the footer look like this in Desktop:
In mobile it should look like this:
I tried the following, but the text seems to go out of bounds (note this is just one of my prototypes, you would get overwhelmed if I posted all of them here):
<div class="row">
<div class="footercol1" style="line-height:10px;display: flex;">
<div id="image" style="float: left; margin-left: 25px;">
<img src="https://picsum.photos/200/200" width="73" />
</div>
<div class="col-sm-6" style="word-wrap:normal;max-width:300px;width:50%;float: right; margin-left: 10px;">
<p style="font-size: 14px;">Text1 blablablablablablablabla</br>
</br>
blablablablablablablablablablablablablablabla</br>
</br>
blablablablablablalblalbblalblbalblbalblalblbabla<br /> <br /> blablablablabalbalblablalblalbbllabllbalblabla.
</p>
</div>
<div class="col-sm-6" style="max-width:300px;float: right; width:50%;margin-left: 50px;font-size: 14px;">
<strong style="color: #489523;">Text 2: </strong> blablablabalbalbalblbalblalblbalblablblalbalblblalblblalblabla <br /><br />
<p>blablablablablablabalbalbalbalblablbablalblablablablabla</p>
<br />
<img class="alignleft" src="https://picsum.photos/70/30" alt="">
</div>
</div>
</div>
FYI: footercol1 doesn't yet contain any CSS rules, hence it's not appended to the question.
UPDATE
Text out of bounds problem is also visible in your snippet as well:
UPDATE 2
Adding the following CSS rules to p:
word-break: normal;
white-space: normal;
partly solves the overflow problem, but it makes the text quite "crambed" as a side effect. Any clue how to fix that?
You're already using flex on your footercol1, so the easiest would probably be to just to use a media query to define the flex direction.
Something like:
.footercol1 {
display: flex;
}
p {
overflow-wrap: break-word;
}
#media only screen and (max-width: 600px) {
.footercol1 {
flex-direction: column;
}
}
<div class="row">
<div class="footercol1" style="line-height:10px;display: flex;">
<div id="image" style="float: left; margin-left: 25px;">
<img src="https://picsum.photos/200/200" width="73" />
</div>
<div class="col-sm-6" style="word-wrap:normal;max-width:300px;width:50%;float: right; margin-left: 10px;">
<p style="font-size: 14px;">Text1 blablablablablablablabla
<br>
<br> blablablablablablablablablablablablablablabla
<br>
<br> blablablablablablalblalbblalblbalblbalblalblbabla
<br>
<br> blablablablabalbalblablalblalbbllabllbalblabla.
</p>
</div>
<div class="col-sm-6" style="max-width:300px;float: right; width:50%;margin-left: 50px;font-size: 14px;">
<strong style="color: #489523;">Text 2: </strong> <p>blablablabalbalbalblbalblalblbalblablblalbalblblalblblalblabla</p>
<br>
<br>
<p>blablablablablablabalbalbalbalblablbablalblablablablabla</p>
<br>
<img class="alignleft" src="https://picsum.photos/70/30" alt="">
</div>
</div>
</div>
flex-direction: row; is default. You should probably read up on flexbox:
https://developer.mozilla.org/en-US/docs/Web/CSS/flex

Flexbox Directions and multiple images within

I am attempting to use flex-box within this build; I have attached both the HTML and CSS code portions. I have attempted to get the DIV container to hold 9 images that should flex-wrap: wrap into 3 rows of 3 images. I am sure I am missing something small; but the best I can do is get one long continuous row of all 9 images.
I have tried to watch some videos and make different changes within HTML and CSS with no success; could anyone please point me in the right direction, or point out my mistake please?
Code:
.gallery {
width: 100%;
height: 100vh;
text-align: center;
background-color: rgb(0, 4, 17);
flex-direction: row;
}
.food-container {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.foodimg {
display: flex;
}
<section class="gallery">
<div>
<h2>OUR FOOD</h2>
<div class="food-container">
<div class="foodimg">
<img src="img/food-avocadotoast.jpg" alt="" />
</div>
<div class="foodimg">
<img src="img/food-burger.jpg" alt="" />
</div>
<div class="foodimg">
<img src="img/food-poutine.jpg" alt="" />
</div>
<div class="foodimg">
<img src="img/food-ribs.jpg" alt="" />
</div>
<div class="foodimg">
<img src="img/food-sandwich.jpg" alt="" />
</div>
<div class="foodimg">
<img src="img/food-sausage.jpg" alt="" />
</div>
<div class="foodimg">
<img src="img/food-steak.jpg" alt="" />
</div>
<div class="foodimg">
<img src="img/food-tacos.jpg" alt="" />
</div>
<div class="foodimg">
<img src="img/food-wings.jpg" alt="" />
</div>
</div>
</div>
</section>
Here, It's best to use grids
.food-container{
display: grid;
grid-template-columns: auto auto auto; /*that should do it*/
}

Can't bring images up HTML

Hey I'm trying to get a website for a server I'm hosting and I'm trying to bring the bottom two images up into the open area above them.
Can anyone help me out I can't wrap my head around this, i'm also new to stack overflow so I'm not as fast as some people I'm sorry, it also won't let me post because there was too much code so I took out the css.
So Here is a "JSFiddle" link to the code:
https://jsfiddle.net/4hy7q2ou/2/
<body>
<div class="card1 one" style="margin-top: 40px;">
<img src="css/images/10.png" width="480" height="270"/>
</div>
<div class="card1 two" style="margin-top: 60px;">
<img src="css/images/4.png" width="480" height="270"/>
</div>
<div class="card2 one">
<h2>
Our Server.
</h2>
<p>
</p>
<p>
</p>
</div>
<div class="card3 two">
<h2>
Our Staff Team.
</h2>
<h3>
Owners:
</h3>
<dl>
Inc0gnitoON
IgnitionON
</dl>
<h3>
Admins:
</h3>
<dl>
N/A
</dl>
<h3>
Moderators:
</h3>
<dl>
WitherVoid_
</dl>
</div>
</body>
<body>
<div class="card1 three" style="margin-bottom: 5px;">
<img src="css/images/7.png" width="480" height="270"/>
</div>
<div class="card1 four">
<img src="css/images/9.png" width="480" height="270"/>
</div>
</body>
You should just align all the images into a square, this is good for cleaner and minimal code:
CSS:
img {
width:20%;
display:inline-table;
margin:5px;
}
I just did "img" but you can actually make this a class e.g. ".card"
HTML:
<div>
<img src="https://via.placeholder.com/350x150" />
<img src="https://via.placeholder.com/350x150" />
<br>
<img src="https://via.placeholder.com/350x150" />
<img src="https://via.placeholder.com/350x150" />
</div>
Output:
This link could also help you achieve this, if my post doesn't help or if you don't quite understand.
EDIT: This should align two images, may need to mess around with the numbers in the CSS to get it to fit better:
CSS:
.block {
width:20%;
display:inline-table;
margin:5px;
}
.side {
display:inline;
margin-left: 50%;
margin-top: -20%;
}
.second {
display:inline;
margin-left: 50%;
margin-top: -1%;
}
HTML:
<div>
<img src="https://via.placeholder.com/350x150" class="block"/>
<img src="https://via.placeholder.com/350x150" class="block"/>
<br>
<img src="https://via.placeholder.com/350x150" class="block"/>
<img src="https://via.placeholder.com/350x150" class="block"/>
</div>
<div>
<img src="https://via.placeholder.com/150x300" class="side"/>
<img src="https://via.placeholder.com/150x300" class="second"/>
</div>

CSS Vertical Align and fancyBox

I am working on a photo gallery(using fancyBox and PHP) for my photography page, and I can't figure out how to make the vertical align for my image gallery to be centered. I currently have placed mock images(from my own gallery) to figure out the layout, and I will then replace them with a PHP query to fill up the gallery with all my content automatically. I have also given each row a (temporary) different color to simply visualize the layout, as well as having a 12 division layout bar at the top for easier handling. The way I currently have my HTML and CSS code set up is as follows:
HTML:
<div class="gallery">
<div class="row row-one">
<div class="col-lg-4">
<a data-type='image' data-fancybox=landscape data-caption=caption href='images/photography/fres/burnaby_mountain.jpg'><img class='img-responsive' src='images/photography/thumbs/burnaby_mountain.jpg'></a>
</div>
<div class="col-lg-4">
<a data-type='image' data-fancybox=landscape data-caption=caption href='images/photography/fres/lions_gate.jpg'><img class='img-responsive' height="500px" src='images/photography/thumbs/lions_gate.jpg'></a>
</div>
<div class="col-lg-4">
<a data-type='image' data-fancybox=landscape data-caption=caption href='images/photography/fres/bubbles.jpg'><img class='img-responsive' src='images/photography/thumbs/bubbles.jpg'></a>
</div>
</div>
</div>
CSS:
.gallery {
display: table;
}
div .row-one {
background-color: red;
display: table-row;
vertical-align: middle;
}
.col-lg-4 {
display: table-cell;
}
As you can see, I have nested the columns inside rows(I did not include the other rows' CSS code, as they're the same except for the background-color attribute, with the intention of automating the gallery later through PHP queries) and rows inside a div container called gallery. From other examples I've seen through looking up for a solution, I've seen people give the main container the display attribute of table, and rows the attribute display: table-row, and lastly the column the table-cell attribute. I have tried this, as well as many other combinations of CSS attributes and have not found a way to center the gallery.
For a better visualization of what I would like to achieve
Thank you for your help, and excuse the lengthy question. I have been searching for a long time and it now feels like something in my code is faulty. I am fairly new to HTML/CSS and although most of my site is working as intended, this is the last bit I need to get it up and running.
Something like this?
.gallery {
display: flex;
height: 30%;
/* flex-direction:column; */
}
.box {
border: 1px solid white;
background: red;
display: flex;
justify-content: center;
flex: 1;
padding: 10px;
}
.inner-box {
align-self: center;
}
<link href="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<div class="gallery">
<div class="box">
<div class="inner-box">
<a data-type='image' data-fancybox=landscape data-caption=caption href='images/photography/fres/burnaby_mountain.jpg'><img class='img-responsive' src='https://i.kinja-img.com/gawker-media/image/upload/t_original/bhjivrw2chm9um9yrrmy.jpg'></a>
</div>
</div>
<div class="box">
<div class="inner-box">
<a data-type='image' data-fancybox=landscape data-caption=caption href='images/photography/fres/lions_gate.jpg'><img class='img-responsive' height="500px" src='https://media.gettyimages.com/photos/cocker-spaniel-puppy-picture-id904219284'></a>
</div>
</div>
<div class="box">
<div class="inner-box">
<a data-type='image' data-fancybox=landscape data-caption=caption href='images/photography/fres/bubbles.jpg'><img class='img-responsive' src='http://cdn.bangli.uk/images/201504/article_9323_1.jpg'></a>
</div>
</div>
</div>
<div class="gallery">
<div class="box">
<div class="inner-box">
<a data-type='image' data-fancybox=landscape data-caption=caption href='images/photography/fres/burnaby_mountain.jpg'><img class='img-responsive' src='https://i.kinja-img.com/gawker-media/image/upload/t_original/bhjivrw2chm9um9yrrmy.jpg'></a>
</div>
</div>
<div class="box">
<div class="inner-box">
<a data-type='image' data-fancybox=landscape data-caption=caption href='images/photography/fres/lions_gate.jpg'><img class='img-responsive' height="500px" src='https://media.gettyimages.com/photos/cocker-spaniel-puppy-picture-id904219284'></a>
</div>
</div>
<div class="box">
<div class="inner-box">
<a data-type='image' data-fancybox=landscape data-caption=caption href='images/photography/fres/bubbles.jpg'><img class='img-responsive' src='http://cdn.bangli.uk/images/201504/article_9323_1.jpg'></a>
</div>
</div>
</div>

align images horizontally from middle css

I read many article about vertical alignment but how can I align 3 images horizontally from middle?
<div class="notification-from-picture"> <img src="images/1.jpg" class="img-circle" /> </div>
<div class="notification-between-from-to"> <img src="images/2.jpg"/> <div>
<div class="notification-to-picture"> <img src="images/3.jpg" class="img-circle"/>< /div>
just do this it will work:
.notification-from-picture,
.notification-between-from-to,
.notification-to-picture
{
display: inline;
}
.notification-from-picture,
.notification-between-from-to,
.notification-to-picture {
display: inline-block;
}
and then put a wrapper div around the divs like so
<div id="image-wrapper">
<div class="notification-from-picture"> <img src="images/1.jpg" class="img-circle" /> </div>
<div class="notification-between-from-to"> <img src="images/2.jpg"/> <div>
<div class="notification-to-picture"> <img src="images/3.jpg" class="img-circle"/>< /div>
</div>
and then do
#image-wrapper {
text-align: center;
}