How to move text down and place a caption below a picture - html

I'm trying to figure out how to both place a caption beneath a picture and move text down. I'm trying to move the text that contains the second unorganized list down.
The figcaption with the text "Crazy Baby" appears on the top right of the picture it's supposed to be under. My understanding was figcaption would accomplish that although I'm clearly doing something wrong.
<div class="container">
<div class="jumbotron">
<div class="text-center">
<h1>The Golden Babies of 3 Orchard Lane</h1>
<p style="font-size: 30px;"><em>The Snady and Baby Maya</em></p>
<img src="http://oi63.tinypic.com/2ijkend.jpg" alt=" haha, sucks" class="Sandy">
<figcaption> <em>Snady Babushka</figcaption> </em>
<font size="5">
<ul>
<strong> Sandy loved</strong>
<li>Her red ball</li>
<li>Hiding in her jungle</li>
<li> Crossing her paws in an X</li>
<li> And most of all her big brother, Jonah </li>
</ul>
</font>
<br>
</div>
<img src="http://oi68.tinypic.com/8yb2f4.jpg" align="left" alt="I'm so sorry you can't see my baby face" class="Maya">
<figcaption><em>Crazy Baby</figcaption></em>
<font size="5">
<ul id="cap">
<div class="text-center">
<strong>Maya Loves</strong>
<li>Tennis balls</li>
<li>People more than dogs</li>
<li>Greeting someone as they enter the house</li>
<li> And of course, her big brother, Jonah</li>
</ul>
</div>
</font>
</div>
</div>

Without seeing your CSS, this is what I'd recommend trying. First thing I would do it make sure you tags are placed in the correct order. In your unordered list, you have the div starting inside the tag, but ending outside of it.
<ul id="cap">
<div class="text-center">
<strong>Maya Loves</strong>
<li>Tennis balls</li>
<li>People more than dogs</li>
<li>Greeting someone as they enter the house</li>
<li> And of course, her big brother, Jonah</li>
</ul>
</div>
Should look like this
<div class="text-center">
<ul id="cap">
<strong>Maya Loves</strong>
<li>Tennis balls</li>
<li>People more than dogs</li>
<li>Greeting someone as they enter the house</li>
<li> And of course, her big brother, Jonah</li>
</ul>
</div>
Then what you can do it with that div, give it a certain width, say the width of the image. Then float both the image and the list, left.
.text-center {
width: 100px; (Just an example)
}
.text-center img,
.text-center ul {
float: left;
}

Related

Overlapping sections, the content of section goes beyond this section

I have problem: first section - header is attachment fixed, and when I reduce the browser window, the background only covers a small portion of the section, the rest of the content is under another section, or completely out of the background. As you will see, only opening this page to the full screen resolves the problem and the sections look correct. By contrast, reducing the window causes the section to fall apart and jump one over the other. Can the cause be lack of clearfixes, or the problem is due to lack of positioning of each section?
https://codepen.io/tubaris/pen/YQQewB/
`<html lang="pl">
<head>
<meta charset="UTF-8">
<meta name="description" content="Omnifood">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Omnifood</title>
<link rel="stylesheet" type="text/css" href="vendors/css/style.css">
<link rel="stylesheet" type="text/css" href="vendors/css/ionicons.min.css">
<link href="https://fonts.googleapis.com/css?family=Lato:100,300,400&subset=latin-ext" rel="stylesheet">
</head>
<body>
<header>
<nav>
<div class="row">
<img src="https://image.ibb.co/bY2jyQ/logo_white.png" alt="Omnifood logo" class="logo">
<ul class="main-nav">
<li>Food delivery</li>
<li>How it works</li>
<li>Our cities</li>
<li>Sign up</li>
</ul>
</div>
</nav>
<div class="header-text-box">
<h1>Goodbye junk food.<br>Hello super healthy meals.</h1>
I’m hungry
Show me more
</div>
</header>
<section class="section-features">
<div class="row">
<h2>Get food fast – not fast food.</h2>
<p class="text-about">Hello, we're Omnifood, your new premium food delivery service. We know you're always busy. No time for cooking. So let us take care of that, we're really good at it, we promise!</p>
</div>
<div class="row">
<div class="feature-col">
<i class="ion-clock icon-big"></i>
<h3>Up to 365 days/year</h3>
<p>Never cook again! We really mean that. Our subscription plans include up to 365 days/year coverage. You can also choose to order more flexibly if that's your style.</p>
</div>
<div class="feature-col">
<i class="ion-jet icon-big"></i>
<h3>Ready in 20 minutes</h3>
<p>You're only twenty minutes away from your delicious and super healthy meals delivered right to your home. We work with the best chefs in each town to ensure that you're 100% happy.</p>
</div>
<div class="feature-col">
<i class="ion-ios-nutrition icon-big"></i>
<h3>100% Organic</h3>
<p>All our vegetables are fresh, organic and local. Animals are raised without added hormones or antibiotics. Good for your health, the environment, and it also tastes better!</p>
</div>
<div class="feature-col">
<i class="ion-card icon-big"></i>
<h3>Order anything</h3>
<p>We don't limit your creativity, which means you can order whatever you feel like. You can also choose from our menu containing over 100 delicious meals. It's up to you!</p>
</div>
</div>
</section>
<section class="section-meals">
<div class="row">
<h2>Omnifood meals showcase</h2>
<p class="text-about">Selected Omnifood meals offered by our company</p>
</div>
<ul class="meals-showcase">
<li>
<figure class="meal-photo">
<img src="https://preview.ibb.co/eTtwCk/1.jpg" alt="egg with vegetables">
</figure>
</li>
<li>
<figure class="meal-photo">
<img src="https://image.ibb.co/iFpgdQ/2.jpg" alt="california rolls sushi">
</figure>
</li>
<li>
<figure class="meal-photo">
<img src="https://preview.ibb.co/igwGCk/3.jpg" alt="asparagus with carrots and meat">
</figure>
</li>
<li>
<figure class="meal-photo">
<img src="https://preview.ibb.co/h74sk5/4.jpg" alt="carrot soup with nuts">
</figure>
</li>
</ul>
<ul class="meals-showcase">
<li>
<figure class="meal-photo">
<img src="https://preview.ibb.co/j4MuyQ/5.jpg" alt="steak with green beans">
</figure>
</li>
<li>
<figure class="meal-photo">
<img src="https://image.ibb.co/m8twCk/6.jpg" alt="roll with egg, rucola and radish">
</figure>
</li>
<li>
<figure class="meal-photo">
<img src="https://preview.ibb.co/bBjEyQ/7.jpg" alt="healthy burger">
</figure>
</li>
<li>
<figure class="meal-photo">
<img src="https://preview.ibb.co/fNWisk/8.jpg" alt="oatmeal with strawberries and cherries">
</figure>
</li>
</ul>
</section>
<section class="section-steps">
<div class="row">
<h2>How it works – Simple as 1, 2, 3</h2>
</div>
<div class="row">
<div class="steps-col1">
<img src="https://image.ibb.co/hHoeXk/app_i_Phone.png" alt="Omnifood app on iPhone" class="app-screen">
</div>
<div class="steps-col2">
<div class="works-step">
<div>1</div>
<p>Choose the subscription plan that best fits your needs and sign up today.</p>
</div>
<div class="works-step">
<div>2</div>
<p>Order your delicious meal using our mobile app or website. Or you can even call us!</p>
</div>
<div class="works-step">
<div>3</div>
<p>Enjoy your meal after less than 20 minutes. See you the next time!</p>
</div>
<img src="https://image.ibb.co/gyPxJQ/download_app.png" alt="app store button">
<img src="https://image.ibb.co/jZWYsk/download_app_android.png" alt="play store button">
</div>
</div>
</section>
</body>
`
I assume what you are asking is why your .features-col div's are cut off.
The reason is, the .features-col divs are taken out of the main flow of the document and are not expanding .section-features div. This is due to the float: left property. When you remove that property, you can instantly see that those columns expand the parent div.
Another way to have the columns aligned to the left side of the page is to have the .row class set to 100% of the window width, then set text-align: left.
Make the .meal-photo class float left.
i.e add float:left to the .meal-photo class in your CSS code.

Is there anyway to add background images when using code pen?

I'm trying to set an image as the background but because it's a browser bases editor, I cannot just link the photo as they are not saved together.
<body>
<div id="backG"> <img src="(image link. i didnt add the link here as it is very long) " alt="concert stadium">
</div>
<div id="mainPage">
<div id="navBar">
<div id="Logo">
<h1 style="font-weight:bold;"> Ice Arena
</h1>
</div>
<ul>
<li style="color:#ffe700;">
Home
</li>
<li>
Gallery
</li>
<li>
Order Form
</li>
<li>
The Arena
</li>
<li>
Contact Us
</li>
< /ul>
</div>
</div>
</body>#
here is the CSS for the photo.
#backG{
diplay:block;
border:0;
}
Free Codepen does not let you host your own images, so you have to upload them somewhere else and link to them. A lot of people use dropbox or imgur
for this. Hope this helps!

alignment of newsletter page is not correct in css

Here is my code:
<div class="wrap">
<div id ="header">
<a href="index" class = "logo">
<img src = "logo.png" alt = "" />
</a>
<nav class="navigation">
<ul>
<li>Share</li> |
<li>Join</li> |
<li>See Safty Tips</li> |
<li>Settings</li>
</ul>
</nav>
</div>
<div class="wrapper">
<img src="accident.png" alt="">
<div id="right-content">
<h2>Hit and Run No Injuries</h2>
<p>2.610 miles from your new neighbor<br />
May 20, 2015 at 12.34 PM </p>
<h4>California HWP 2 - High Level</h4>
</div>
</div>
<div class="wrap">
<ul class="secure_v5">
<li id="li-incident">
<a class="inviteLink dark" href="/v5/Resources.aspx?IFrameURL=Invitationv5&vn=&gORn=1">See Incident Location</a>
</li>
<li id="login-signup">
<a class="button dark" href="V4/Login.aspx?v5=1">Share Incident with Friends</a>
</li>
</ul>
</div>
<div class="thanks">
<p>Sincerely,<br />
The AlertID Team</p>
</div>
<p style="text-align:center;">This sponsor is helping to protect your neighborhood</p>
<div class="footer-links">
<ul>
<li></li>
<li></li>
<li></li>
</ul>
</div>
</div>
and here is jsfiddle , (didn't include images)
When i run this code, some alignment is not correct,
I need something same like this
I just confused with which exact css can be used, Can anyone help me please?
Thanks,
Use HTML tables to control the design layout and some presentation. You may be used to using pure CSS layouts for your web pages, but that approach just won’t hold up in an email environment.
Use inline CSS to control other presentation elements within your email, such as background colors and fonts.
You just put div #right-content to right
try it on CSS.
#right-content {
float:right;
width:600px;
}
#right-content h2{
text-align:center;
}
I create a little attribute to h2 inside div #right-content
and define a fixed width for right-content. It's necessary because of attribute float: right.

split navbar into 2 parts

So I got this header, I want the logo in the middle, and then 2 links on the left and 2 links on the right. I guess I know how to do this but not what the best way is. Got what I think that works below. Edit: Obviously no css applied yet, gotta get the html straight first.
So here's the header
<header>
<div id="head-wrap">
<nav>
<ul>
<li>Smartphones</li>
<li>Tablets</li>
<li>Laptops</li>
<li>Desktops</li>
</ul>
</nav>
</div>
</header>
What might work
<header>
<div id="head-wrap">
<nav>
<div id="nav-left>
<ul>
<li>Smartphones</li>
<li>Tablets</li>
</ul>
</div>
<img src="logo.png" alt="Logo" height="42" width="42">
<div id="nav-right">
<ul>
<li>Laptops</li>
<li>Desktops</li>
</ul>
</div>
</nav>
</div>
</header>
Is this the best way or should I do it differently?
Regards
Your example has a lot of superfluous HTML elements in it. Instead of multiple div containers, try something like this:
<nav>
<ul>
<li>
Smartphones
</li>
<li>
Tablets
</li>
<li>
<img src="logo.png" alt="Logo" height="42" width="42" />
</li>
<li>
Laptops
</li>
<li>
Desktops
</li>
</ul>
</nav>
Then display the li elements inline:
li{
display:inline;
}
Example
Obviously you'll need to edit this more to fit your own needs, but a simple structure is the start of a good design.

HTML/CSS a <div> won't go below another one

I have this page where all the div's seem to work and then all of the sudden my last one breaks. I have two divs in my CSS, one being centeredRight and one centeredLeft. They are lined up down the page. But my last div on the left seems to get pushed to the right.
Here is my CSS.
.centeredlistleft {
width: 300px;
margin: 0 auto;
text-align: left;
border: 2px solid;
float: left;
margin-bottom: 25px;
padding-right: 10px;
}
.centeredlistright {
width: 300px;
margin: 0 auto;
text-align: left;
border: 2px solid;
float: right;
margin-bottom: 25px;
padding-right: 10px;
}
.body {
margin: 0 auto;
padding: 0;
text-align: center;
color: purple;
background-color: pink;
}
And here is my HTML.
<div id="sandrcontainer" class="body" style="width:700px">
<div id="onsieforbaby" class="centeredlistleft" >
<h3> Onesie for Baby </h3>
<ul>
<li>
Price
<ul>
<li>$10.00</li>
</ul>
</li>
<li>
Description
<ul>
<li>It's a boy onesie for a new baby boy. Carter onesies are used. Can ask for specific size. Can also make one for girls using pink.</li>
</ul>
</li>
</ul>
</div>
<div id="largetennistowel" class="centeredlistright">
<h3> Large Tennis Towel </h3>
<ul>
<li>
Price
<ul>
<li>$14.00</li>
</ul>
</li>
<li>
Size
<ul>
<li>16 x 26 (Inches)</li>
</ul>
</li>
<li>
Description
<ul>
<li> Cotton fleece. Very soft. Washes Well. Can be personalized. Check out the photo gallery for examples. Ask seller what color towels are available at time of order.</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="sandrcontainer2" class="body" style="width:700px">
<div id="largegolftowel" class="centeredlistleft">
<h3> Large Golf Towel </h3>
<ul>
<li>
Price
<ul>
<li>$14.00</li>
</ul>
</li>
<li>
Size
<ul>
<li>16 x 26 (Inches)</li>
</ul>
</li>
<li>
Description
<ul>
<li> Golf towel. Elegant. Large white towel. Cotton fleece. Very soft. Can be personalized. Check out photo gallery for examples. Ask seller what color towels are avaiable at time of order. This towel has a grommet and can be hung on golf bags. Could also make this on fingertipe towel for guest bath or on linen towel for that elegant look.</li>
</ul>
</li>
</ul>
</div>
<div id="terrysmalltowel" class="centeredlistright">
<h3> Terry Small Towel </h3>
<ul>
<li>
Price
<ul>
<li>$11.00</li>
</ul>
</li>
<li>
Size
<ul>
<li>11 x 18 (Inches)</li>
</ul>
</li>
<li>
Description
<ul>
<li> With fringe. Made of 100% cotton loop terry. Can be personalized. Check out photo gallery for examples. Ask seller what color towels are avaiable at time of order.</li>
</ul>
</li>
</ul>
</div>
</div>
<div id="sandrcontainer3" class="body" style="width:700px">
<div id="contactmerands" class="centeredlistleft" >
<p> Please make sure to send me an email before any orders. I may not have the color towel you want but can always order more </p>
</div>
<div id="smallfingertip" class="centeredlistright" >
<h3> Small Fintertip Holiday Towel </h3>
<ul>
<li>
Price
<ul>
<li>$11.00</li>
</ul>
</li>
<li>
Size
<ul>
<li>11 x 18 (Inches)</li>
</ul>
</li>
<li>
Description
<ul>
<li> Terry small towel with decorated cat for xmas. Made of 100% cotton loop terry. Can be personalized. Check out photo gallery for examples. Ask seller what color towels are available at time of order.</li>
</ul>
</li>
</ul>
</div>
</div>
TLDR - ctrl f for "Contactmerands" and please explain to me why this box is getting pushed to the bottom RIGHT of the large golf towel box. It should appear under the large golf towel box just like the rest of the divs.
If you would like to see what I mean you can go to my school web portal where I have the page posted HERE.
When an element is floated, it is essentially removed from the flow of the document. Thus, when a parent element's children are all floated, the parent collapses upon itself as it doesn't have any defined dimensions.
To solve this, you could set either overflow:hidden or overflow:auto on the parent elements. This essentially forces it to contain the children elements, therefore preventing it from collapsing.
Add the following CSS and your problem is solved:
#sandrcontainer,
#sandrcontainer2,
#sandrcontainer3 {
overflow: hidden;
}
Sometimes changing the overflow property will conflict with existing CSS. You could alternatively use the pseudo element clearfix:
.clearfix:after {
content: '';
clear: both;
display: table;
}
You must clear your floats in order to achieve the desired effect.
I suggest using a valid clearfix for this.
You need to declare this in CSS:
.clearfix:after {
clear:both;
content:".";
display:block;
font-size:0;
height:0;
visibility:hidden;
}
.clearfix { display:block; }
Now wrap all your elements that should float next to each other in a DIV and apply the clearfix class:
<div class="clearfix">
<!-- put your divs here //-->
</div>
<!--put your last div here //-->