Text flowing in CSS - html

Got problem with image nad text flowing.
I have image, from the right side text, but if height of text div becomes more then image div height the is beeing written from the new line under the picture, i don't need that. How to create something like
My code:
HTML:
<div id="wrapper">
<div id="content">
<div id="image" class="fleft"><img src="img/image.png" alt="dart-face"/></div>
<div id="text">
<h1>Darth Vader</h1>
<p>Darth Vader (born Anakin Skywalker) is a central character in the Star Wars saga,[1][2][3] appearing as one of the main antagonists of the original trilogy and as the main protagonist of the prequel trilogy.
<p>The character was created by George Lucas and numerous actors have portrayed him. His appearances span all six Star Wars films, and he is an important character in the expanded universe of television series, video games, novels, literature and comic books.</p>
</p>
</div>
</div>
</div>
CSS:
*{
margin: 0;
padding: 0;
}
body
{
font: 12px Arial, Helvetica, sans-serif;
background: url('../img/pattern.png');
}
#wrapper
{
max-width: 80%;
margin: 50px auto;
-webkit-box-shadow: 0 5px 13px rgba(0,0,0,0.75);
-moz-box-shadow: 0 5px 13px rgba(0,0,0,0.75);
-o-box-shadow: 0 5px 13px rgba(0,0,0,0.75);
-ms-box-shadow: 0 5px 13px rgba(0,0,0,0.75);
box-shadow: 0 5px 13px rgba(0,0,0,0.75);
-webkit-border-radius: 10px;
-moz-border-radius: 10px;
-o-border-radius: 10px;
-ms-border-radius: 10px;
border-radius: 10px;
background: -webkit-linear-gradient(#d8d8d8,#fff,#fff,#c0c0c0);
background: -moz-linear-gradient(#d8d8d8,#fff,#fff,#c0c0c0);
background: -o-linear-gradient(#d8d8d8,#fff,#fff,#c0c0c0);
background: -ms-linear-gradient(#d8d8d8,#fff,#fff,#c0c0c0);
background: linear-gradient(#d8d8d8,#fff,#fff,#c0c0c0);
}
#content
{
display: inline-block;
/*position: relative;*/
}
#image
{
margin: 34px;
}
#text
{
/*position: absolute;*/
line-height: 20px;
text-align: left;
margin: 34px 25px 25px 25px;
}
#text h1, #text p
{
margin-bottom: 20px;
}
.fleft
{
float: left;
}
.fright
{
float: right;
}

Set overflow:hidden to #test to trigger its layout so it sees and stands away from floatting element around it and keep his inside .
#text {
overflow:hidden;/* triggers layout , so it cares about inside and outside floatting elements */
line-height: 20px;
text-align: left;
margin: 34px 25px 25px 25px;/* you might need to reset these since it will bang against floatting image */
}

Can also try this...The following code will easily fix the issue.
Here is updated HTML...Posting only updated part
<div id="content">
<div id="image"><img src="img/image.png" alt="dart-face"/></div>
<div id="text">
<h1>Darth Vader</h1>
<p>
Darth Vader (born Anakin Skywalker) is a central character in the Star Wars saga,[1][2][3] appearing as one of the main antagonists of the original trilogy and as the main protagonist of the prequel trilogy.
<p>
The character was created by George Lucas and numerous actors have portrayed him. His appearances span all six Star Wars films, and he is an important character in the expanded universe of television series, video games, novels, literature and comic books.
</p>
</p>
</div>
<div style="clearfix"> </div>
</div>
Now we have to remove unwanted code from CSS
Please remove following code from your CSS (same one to posted in question)
#image
{
margin: 34px;
}
#text
{
/*position: absolute;*/
line-height: 20px;
text-align: left;
margin: 34px 25px 25px 25px;
}
.fleft
{
float: left;
}
.fright
{
float: right;
}
Now simply add the following CSS
#image
{
float: left;
width:30%; /*Choose width accordingly*/
}
#text
{
float: left;
width:60%; /*Choose width accordingly*/
}
.clearfix
{
display:block;
clear:both;
content:'';
}
try this hope this help....and if any query ? donot hesitate to comment THANKS

Related

Photos won't align along the right edge, weird white space with padding

html {
padding: 0px;
border: dashed;
margin: 0px 0px 0px 0px;
}
body {
padding: 15px;
border: dashed;
margin: 0px 0px 0px 0px;
}
ul {
position: fixed;
float: left;
padding: 10px 10px;
border: dashed;
margin: 250px 10px 550px;
}
li{
padding: 0px;
border: solid;
border-width: 1px;
margin: 0px 0px 0px 0px;
}
img {
height: 200px;
width: 200px;
padding: 0px;
margin: 0px 0px 0px 0px;
}
#imageright {
width: 20%;
position: inherit;
float: right;
padding: 0px;
border: none;
margin: 0px 0px 0px 0px;
}
h1 {
text-align: center;
}
h2 {
text-align: center;
}
h3 {
text-align: left;
padding: 0%;
border: dashed;
margin: 25px 25% 10px;
}
p {
text-align: center;
padding: 1% 5%;
border: dashed;
margin: 0% 25% 0% 25%;
}
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8" name="viewport" content="width=device-width initial-scale=1">
<title>Playing Card Information</title>
</head>
<!-- Playing Card RED = #d12d36 -->
<body>
<h1><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/42/Playing_cards_collage.jpg/200px-Playing_cards_collage.jpg" alt="Random assortment of playing cards, each overlapping another. King of clubs is in the middle.">
Playing Cards</h1>
<ul>
<li>Home/History</li>
<li>Modern Deck Formats</li>
<li>Manufacturing</li>
<li>Non-standard Design and Use</li>
<li>Symbols in Unicode</li>
<li>Cardistry</li>
</ul>
<ul id="imageright":>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/2/2c/Tarockkarten_in_der_Hand_eines_Spielers.jpg" alt="A hand of Tarot playing cards."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/c/cb/Bavarian_pack-Suit_of_Bells.jpg" alt="The suit of Bells from a Bavarian pattern pack."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/8/88/Ming_Dynasty_playing_card%2C_c._1400.jpg" alt="A Chinese printed playing card date c. 1400 AD, Ming Dynasty, found near Turpan, measuring 9.5 by 3.5cm."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/7/72/Mamluk_kanjifah_cards.png" alt="Four Mamluk playing cards."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/c/c9/Knave_of_coins_-_Italy_2_deck.png" alt="Knave of Coins from the oldest known European deck"></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/a/a5/Pietro_Longhi_-_Card_Players_-_KMSst426_-_Statens_Museum_for_Kunst.jpg" alt="Card players in 18th Century Venice, by Pietro Longhi."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/7/72/Girl_with_Cards_by_Lucius_Kutchin%2C_1933.jpg" alt="Girl with Cards by Lucius Kutchin, 1933, Smithsonian American Art Museum."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/6/6b/Imperial_Bower.png" alt="Imperial Bower, the earliest Joker, by Samuel Hart, c. 1863. Originally designed for use in a specific variant of euchre, it contains instructions for unfamiliar players."></li>
</ul>
</body>
</html>
I want the photos to align vertically with zero margin or padding between photos and the right edge of the window. The list of images has its own id giving it the special style in my CSS file which should override the original ul{}. The two remaining elements that could affect the weird padding both have padding set to 0.
html(left) CSS(right)
What it looks like in browser
I have had every element set to 0 padding and it remained present. I have borders around the individual li{} to show the padding is within the li element.
Additionally if you know how to remove the bullet points that'd be great. Even if this means I have to change the element to something I'm unfamiliar with. I am a novice and this project is a work in progress for a class.
This is because of the font!
Well, you think it's only an image list, but actually, it's a text like list!
and hence all images are considered as text!
QS: Well, even if it was considered as text, why this space?
Ans: Its space between two text lines (between two images)
How to solve:
Set its font-size to 0
Also, two remove those bullet points use list-style-type:none;
Code:
html {
padding: 0px;
border: dashed;
margin: 0px 0px 0px 0px;
}
body {
padding: 15px;
border: dashed;
margin: 0px 0px 0px 0px;
}
ul {
position: fixed;
float: left;
padding: 10px 10px;
border: dashed;
margin: 250px 10px 550px;
list-style-type:none;
}
li{
padding: 0px;
border: solid;
border-width: 1px;
margin: 0px 0px 0px 0px;
}
img {
height: 200px;
width: 200px;
padding: 0px;
margin: 0px 0px 0px 0px;
}
#imageright {
width: 20%;
position: inherit;
float: right;
padding: 0px;
border: none;
margin: 0px 0px 0px 0px;
font-size:0;
}
h1 {
text-align: center;
}
h2 {
text-align: center;
}
h3 {
text-align: left;
padding: 0%;
border: dashed;
margin: 25px 25% 10px;
}
p {
text-align: center;
padding: 1% 5%;
border: dashed;
margin: 0% 25% 0% 25%;
}
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8" name="viewport" content="width=device-width initial-scale=1">
<title>Playing Card Information</title>
</head>
<!-- Playing Card RED = #d12d36 -->
<body>
<h1><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/42/Playing_cards_collage.jpg/200px-Playing_cards_collage.jpg" alt="Random assortment of playing cards, each overlapping another. King of clubs is in the middle.">
Playing Cards</h1>
<ul>
<li>Home/History</li>
<li>Modern Deck Formats</li>
<li>Manufacturing</li>
<li>Non-standard Design and Use</li>
<li>Symbols in Unicode</li>
<li>Cardistry</li>
</ul>
<ul id="imageright":>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/2/2c/Tarockkarten_in_der_Hand_eines_Spielers.jpg" alt="A hand of Tarot playing cards."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/c/cb/Bavarian_pack-Suit_of_Bells.jpg" alt="The suit of Bells from a Bavarian pattern pack."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/8/88/Ming_Dynasty_playing_card%2C_c._1400.jpg" alt="A Chinese printed playing card date c. 1400 AD, Ming Dynasty, found near Turpan, measuring 9.5 by 3.5cm."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/7/72/Mamluk_kanjifah_cards.png" alt="Four Mamluk playing cards."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/c/c9/Knave_of_coins_-_Italy_2_deck.png" alt="Knave of Coins from the oldest known European deck"></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/a/a5/Pietro_Longhi_-_Card_Players_-_KMSst426_-_Statens_Museum_for_Kunst.jpg" alt="Card players in 18th Century Venice, by Pietro Longhi."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/7/72/Girl_with_Cards_by_Lucius_Kutchin%2C_1933.jpg" alt="Girl with Cards by Lucius Kutchin, 1933, Smithsonian American Art Museum."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/6/6b/Imperial_Bower.png" alt="Imperial Bower, the earliest Joker, by Samuel Hart, c. 1863. Originally designed for use in a specific variant of euchre, it contains instructions for unfamiliar players."></li>
</ul>
</body>
</html>
Recomendations:
Don't use li&ul for image lists!
Use div&flexbox
Refer more here
There are a few things which this snippet alters:
To get rid of the blobs on the list items you can set list-style-type to none. If you put this in the ul styling it'll get applied to all the li elements.
You have sized the elements at 200px height but at 20% width. This means that the wider the viewport the wider the element so that gives extra white space to the right of images. The snippet sets the width and height the same AND sets the img to object-fit cover. This is because you could get distortion on the images as they stretched to fit fixed width and height.
The body has been given some padding which will make the cards not align right up to the right hand side of the screen.
The little gap below each image is put there by the system depending on font size (same happens for inline-blocks for example) so set the font size to 0 in the ul to get rid of it (remember to set a fontsize in an li element if you ever want to show text as well as the img there!).
<!DOCTYPE html>
<html lang='en'>
<head>
<meta charset="utf-8" name="viewport" content="width=device-width initial-scale=1">
<title>Playing Card Information</title>
<style>
html {
padding: 0px;
border: dashed;
margin: 0px 0px 0px 0px;
}
body {
padding: 15px;
/* ADDED */
padding: 0;
border: dashed;
margin: 0px 0px 0px 0px;
}
ul {
position: fixed;
float: left;
padding: 10px 10px;
border: dashed;
margin: 250px 10px 550px;
}
li {
padding: 0px;
border: solid;
border-width: 1px;
margin: 0px 0px 0px 0px;
}
img {
height: 200px;
width: 200px;
/* ADDED */
object-fit: cover;
padding: 0px;
margin: 0px 0px 0px 0px;
}
#imageright {
width: 20%;
/* ADDED */
width: 200px;
position: inherit;
float: right;
padding: 0px;
border: none;
margin: 0px 0px 0px 0px;
/* ADDED */
list-style-type: none;
/* ADDED */
font-size: 0px;
}
h1 {
text-align: center;
}
h2 {
text-align: center;
}
h3 {
text-align: left;
padding: 0%;
border: dashed;
margin: 25px 25% 10px;
}
p {
text-align: center;
padding: 1% 5%;
border: dashed;
margin: 0% 25% 0% 25%;
}
</style>
</head>
<!-- Playing Card RED = #d12d36 -->
<body>
<h1><img src="https://upload.wikimedia.org/wikipedia/commons/thumb/4/42/Playing_cards_collage.jpg/200px-Playing_cards_collage.jpg" alt="Random assortment of playing cards, each overlapping another. King of clubs is in the middle."> Playing Cards</h1>
<ul>
<li>Home/History</li>
<li>Modern Deck Formats</li>
<li>Manufacturing</li>
<li>Non-standard Design and Use</li>
<li>Symbols in Unicode</li>
<li>Cardistry</li>
</ul>
<ul id="imageright" :>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/2/2c/Tarockkarten_in_der_Hand_eines_Spielers.jpg" alt="A hand of Tarot playing cards."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/c/cb/Bavarian_pack-Suit_of_Bells.jpg" alt="The suit of Bells from a Bavarian pattern pack."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/8/88/Ming_Dynasty_playing_card%2C_c._1400.jpg" alt="A Chinese printed playing card date c. 1400 AD, Ming Dynasty, found near Turpan, measuring 9.5 by 3.5cm."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/7/72/Mamluk_kanjifah_cards.png" alt="Four Mamluk playing cards."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/c/c9/Knave_of_coins_-_Italy_2_deck.png" alt="Knave of Coins from the oldest known European deck"></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/a/a5/Pietro_Longhi_-_Card_Players_-_KMSst426_-_Statens_Museum_for_Kunst.jpg" alt="Card players in 18th Century Venice, by Pietro Longhi."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/7/72/Girl_with_Cards_by_Lucius_Kutchin%2C_1933.jpg" alt="Girl with Cards by Lucius Kutchin, 1933, Smithsonian American Art Museum."></li>
<li><img src="https://upload.wikimedia.org/wikipedia/commons/6/6b/Imperial_Bower.png" alt="Imperial Bower, the earliest Joker, by Samuel Hart, c. 1863. Originally designed for use in a specific variant of euchre, it contains instructions for unfamiliar players."></li>
</ul>
</body>
</html>

Brackets issue and it's driving me crazy

I really hope someone out there knows something about Brackets! I'm doing a project for school and it was going just fine yesterday. I have four pages, a home page, events page, contact page and about page. Somehow in the inspect element panel I have the events page loaded in the styles section and so now, no matter what I do the background image that is in the events page is loaded in all my other pages. Even if I delete it from the CSS! I can't figure it out and I have no idea how I got it there to begin with! How do I get rid of it so that I can style the pages differently with different images and all that?! Not sure how the css and html can help but I'll load it anyway.
<!doctype html>
<html>
<head>
<title>events</title>
<meta charset="utf-8">
</head>
<link href='https://fonts.googleapis.com/css?family=Miltonian+Tattoo' rel='stylesheet' type='text/css'>
<link href='https://fonts.googleapis.com/css?family=Convergence' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="eventscss.css">
<body>
<div id="header">
<h1>Ready...Set...SPLASH!!</h1>
</div>
<aside class="sidebar1">
<h2>Where to?</h2>
<div id="mainnav">
<ul>
<li>Home</li>
<li>Events</li>
<li>Contact</li>
<li>About</li>
</ul>
</div>
<div id="one">
<img src="surprisedgirl.jpg" height="200" width="250">
</div>
</aside>
<article class="main">
<h2>PLAN YOUR NEXT BIRTHDAY WITH US!!</h2>
<p>Does someone have a birthday coming up? Why not plan a pool party? We have three different party packages to choose from.
You caan reserve anything from a little table, to an entire pool. We'll try our best to make sure the kiddos have the best
birthday ever. They'll be sure to talk about it for months to come. And you'll feel great knowing that you made it happen.
(Way to go!...)</p>
<p> The first Party Package that we offer is the standard Bronze Package.
You'll get three hours and ride passes for all. Skip straight to the front of the line of any slide you choose. We have party rooms for reservation or you
can choose a tent outdoors and poolside. Three large one topping pizzas, beverages, and wrist bands for the slides are all included for a set price of
$125. Limit of 10 wristbands. Additional bands can be purchaced for $2.00 per band.</p>
<p> Second choice for your party plans would be the Silver Package. Five party hours to toy around with, 15 slide wristbands,
jump to the front freedom, five large pizzas (three 1 topping, two 2-3 topping) beverages, party room or tent. All of this for only $150!</p>
<p> The third and final option that we offer is the Gold Package. This is the Mac Daddy of em' all! This package
includes all day play, unlimited wristbands, jump to the front freedom, eight large pizzas (of your choice) beverages, party room or tent, and a special Happy Birthday
message announced over the loud speaker before singing Happy Birthday! Your birthday boy or girl will feel as if they are on top of the world! This deal can be yours
for only $200! <br> Talk about a deal to be had!!</p>
</article>
<aside class="sidebar2">
<div id="img1">
<img src="goggle_kids_small.jpg" height="150" width="200">
</div>
<div id="img2">
<img src="waterparkkids.jpg" height="150" width="250">
</div>
<div id="img3">
<img src="slide-01.jpg" height="150" width="200">
</div>
</aside>
<style>
#one img {
padding-right:20px;
margin:10px;
width: 250px;
height: 300px;
padding-top: 60px;
transform: rotate(-10deg)
}
#img1 img{
padding-right:40px;
margin:10px;
width: 250px;
height: 200px;
transform: rotate(10deg);
}
#img2 img{
padding-right:40px;
margin:10px;
width: 250px;
height: 200px;
transform: rotate(-10deg);
}
#img3 img{
padding-right:40px;
margin:10px;
width: 250px;
height: 200px;
transform: rotate(10deg);
padding-top:20px;
}
</style>
<div id="footer">
<h4>Lilly's Pad 238 Main Street, Asheville NC 28804 (828)-669-4828 www.Lillyspad.com</h4>
h1{
padding-top: 15px;
margin:0;
height: 100px;
font-family:"Miltonian Tattoo";
font-size: 3em;
color:whitesmoke;
text-shadow:3px 3px black;
text-align: center;
background-image: url(pool-water-hd-inspiration-1.jpg);
background-repeat: repeat-x;
}
/*First column*/
.sidebar1 h2, .sidebar2 h2{
font-family: "Miltonian Tattoo";
text-align: center;
color: black;
text-shadow: 2px 2px white;
}
.sidebar1{
float: left;
width: 20%;
padding: 0 20px 0 10px;
background-image: url(Water-Drop-background.jpg);
height: 800px;}
#one{border-radius: 50%;
}
/*all main styles*/
#mainnav li{
list-style-type: none;
padding-top: 30px;}
#mainnav a:link{
text-decoration: none;
background-color:#feff00;
border-radius: 15px;
display: block;
background-size: 15px;
width: 100px;
padding: 5px 5px 5px 10px;
margin-bottom: 5px;
padding-right: 20px;
font-family: "Miltonian Tattoo";
color:black;
text-align: center;}
#mainnav{
background-color:#ccf3ff;
-webkit-box-shadow: -8px 11px 25px 0px rgba(0,0,0,0.68);
-moz-box-shadow: -8px 11px 25px 0px rgba(0,0,0,0.68);
box-shadow: -8px 11px 25px 0px rgba(0,0,0,0.68);
height: 300px;
border-radius: 20px;
padding-left:45px;}
.main{
float: left;
width: 60%;
height:800px;
padding: 0 20px;
background-image: url(happybirthday.jpg);
background-size: 400px;
background-repeat: no-repeat;
background-position: bottom;
}
.main h2{
font-family: "Miltonian Tattoo";
text-align: center;
font-size: 2em;
}
.main h3{font-family: "Miltonian Tattoo";}
.main p{
font-family: Convergence;
}
/*Second Column*/
.sidebar2{
background-image: url(Water-Drop-background.jpg);
height: 800px;
float: right;
width: 20%;
padding: 0 10px 0 20px;}
.sidebar2 p{
font-family: Convergence;
font-style: italic;
background-color: aliceblue;
text-align: center;
border-radius: 30px;
font-size: 0.9em;
-webkit-box-shadow: 10px 10px 14px -4px rgba(0,0,0,0.75);
-moz-box-shadow: 10px 10px 14px -4px rgba(0,0,0,0.75);
box-shadow: 10px 10px 14px -4px rgba(0,0,0,0.75);
}
#footer{
background-color: #feff00;
clear: both;
height: 20px;
text-align: center;
font-style: italic;
font-size: .9em;
}
/*To keep from having float drops*/
*{
-moz-box-sizing: border-box;
box-sizing: border-box;}

Prevent float right sections overlap the wrapper

I have every other section floated a different direction but the sections that are floated right overlap the wrapper. How do I get it to not do that?
Also, I tried incorporating the float into the nth-child (odd/even) of the css and I couldn't get it to work right. If someone can help me do that so I can get rid of the float classes I would be grateful.
http://codepen.io/anon/pen/bdoQPQ
body,
html {
font: 1em "Open Sans", sans-serif;
margin: 0px;
padding: 0px;
}
#wrapper {
padding: 0px 10px 0px 10px;
width: 100%;
}
.vertSection {
width: 75%;
height: 175px;
border-top: 1px solid black;
border-bottom: 1px solid black;
margin: 0px 0px 15px 0px;
padding: 5px 0px 0px 10px;
box-shadow: 0px 3px 5px #888, 0px -3px 5px #888;
display: inline-block;
}
.vertSection:nth-child(even) {
float: left;
}
.vertSection:nth-child(odd) {
float: right;
text-align: right;
}
.vertSection p {
text-align: left;
}
.vertSection img {
line-height: 75px;
}
.floatL {
float: left;
}
.floatR {
float: right;
}
.clear {
clear: both;
}
<section id="wrapper">
<section>
<h1>Header</h1>
<p>This is where some information on my services would go.</p>
</section>
<section class="vertSection">
<img src="images/html5css3.png" class="floatL">
<h2>Heading</h2>
<p>A bunch of text and description here!</p>
</section>
<section class="vertSection">
<img src="images/responsive.png" class="floatR">
<h2>Heading</h2>
<p>A bunch of text and description here!</p>
</section>
<section class="vertSection">
<img src="images/search.jpg" class="floatL">
<h2>Heading</h2>
<p>A bunch of text and description here!</p>
</section>
<section class="vertSection">
<img src="images/communicate.png" class="floatR">
<h2>Heading</h2>
<p>A bunch of text and description here!.</p>
</section>
</section class="">
The problem is likely related to this part.
#wrapper {
padding: 0px 10px 0px 10px; /*top right bottom left*/
width: 100%;
}
So 100% + 10px + 10px causes the overflow, remove width:100% it should all good. By the way, it's safer to also set section {display:block;} in case some browsers don't render it as block level element.

The text goes over the image and not under it

The problem is that when I added an image to my html page,and I tried to write something to continue my working,the text was going over the image.I want the text to be going under the image.I don't want to use 50 "br" tags so that I can write under it.Do you know what's the problem guys ?
.poze {
max-width: 100%;
margin-top: 0.5em;
margin-bottom: 1em;
-webkit-box-shadow: rgba(0, 0, 0, 0.199219) 0px 0px 20px;
background: white;
border: 1px solid #CCC;
border-bottom-left-radius: 5px 5px;
border-bottom-right-radius: 5px 5px;
border-top-left-radius: 5px 5px;
border-top-right-radius: 5px 5px;
padding: 8px;
"
}
.cerculet {
display: block;
}
.cerculet:after {
display: block;
clear: both;
content:' ';
}
.cerculet p {
font-weight: bold;
}
.cerculet h2 {
font-size: 120%;
height: 145%;
width: 1.6em;
height: 1.6em;
text-align: center;
border-radius: 50%;
background-color: black;
color: white;
white-space: nowrap;
float: left;
margin-right: 15px;
}
That was the CSS.Now I'll post the html code:
<h2>
<div class="cerculet">
<h2>2 </h2>
<p>
<font size="5" face="Cambria">
Gripa Spaniola (1918 - 1919):<br>
A ucis intre 50 si 100 de milioane de oameni din intreaga<br>
lume in mai putin de 2 ani
</font>
</p>
</div>
</h2>
<br>
<img src="http://s6.postimg.org/6oyuxe1e9/Spanish_Flu.jpg" class="poze" style="position:absolute; left:150px;">
<div>
<h1>
As you can see,the text doesn't go under my image.How to fix this problem guys?
</h1>
</div>
I hope you'll understand the code.I mean,I used that "4 spaces indent" or whatever and I don't know if that's the right way to post the code.If I copy/paste all,it won't show it right..
https://jsfiddle.net/9hw89uog/
Remove position:absolute from your image styles, it is an inline style in your case
Here is one solution: https://jsfiddle.net/73s1c4h1/2/
<div class="clearfix">
<img src="https://images.nga.gov/images/bindo.jpg" class="poze"style="margin-left:150px;">
<div>
<h1 >
Now the text should be clear of the image and positioned below it.
</h1>
</div>
</div>
This involves using the all famous "clearfix" CSS solution. You will need to wrap the image and text in a div, then place class="clearfix" in that div. The clearfix CSS is here: https://css-tricks.com/snippets/css/clear-fix/
It will force the div element to clear the children elements.
Clearfix CSS:
.clearfix:after {
visibility: hidden;
display: block;
font-size: 0;
content:" ";
clear: both;
height: 0;
}
* html .clearfix { zoom: 1; } /* IE6 */
*:first-child+html .clearfix { zoom: 1; } /* IE7 */
The second solution is a bit simpler; just set position: relative; rather than absolute. https://jsfiddle.net/73s1c4h1/1/
You may also need to change left: 150px to margin-left: 150px

Why is my input's box shadow not being reset?

I'm applying a box shadow to a form and thus all of it's inputs. For the submit button I have it as a specific class to which I'm trying too apply box-shadow: none, but it doesn't seem to be taking. Any idea why?
css:
body {
background: #b3b3b3;
font: 16px helvetica, arial, sans-serif;
}
.clear_both {
clear: both;
}
/* Heading */
#HeaderContainer {
background: #272727;
height: 120px;
box-shadow: 5px 5px 5px #7f7f7f;
}
#NavigationContainer {
position: relative;
float: right;
top: 90px;
margin: -5px 30px 0px 0px;
}
#NavigationContainer .current_page a {
color: #2e7de8;
text-shadow: 0px 0px 10px #2e7de8;
}
#NavigationContainer a:hover {
text-shadow: 0px 0px 15px #2e7de8;
}
#NavigationContainer li {
display: inline;
margin-left: 40px;
padding: 5px;
}
#NavigationContainer a {
text-decoration: none;
color: #FFF;
font: bold 20px helvetica, arial, sans-serif;
}
/* Content */
#MainContent {
width: 960px;
margin: 20px auto 40px auto;
}
#ContentRightColumn {
float: right;
width: 240px;
background: #272727;
padding: 20px 20px 40px 20px;
margin-top: 20px;
color: #fff;
border-radius: 15px;
box-shadow: 5px 5px 5px #7f7f7f;
}
#ContentRightColumn h1 {
font-size: 24px;
font-weight: bold;
}
#ContentRightColumn h3 {
font-size: 14px;
font-weight: bold;
}
#ContentRightColumn p {
font-size: 16px;
}
.news_item {
margin-top: 15px;
}
#ContentLeftColumn {
width: 640px;
padding: 20px;
}
#ContentLeftColumn h1 {
background: #272727;
color: #FFF;
max-width: 500px;
font-size: 24px;
font-weight: bold;
padding: 5px 10px;
border-radius: 15px;
box-shadow: 5px 5px 5px #7f7f7f;
position: relative;
right: 40px;
}
#ContentLeftColumn p {
text-indent: 1em;
}
.content_item {
margin-top: 20px;
}
.content_item p {
margin-top: 20px;
}
.content_item h2 {
font-weight: bold;
font-size: 24px;
color: #004dd4;
text-shadow: 3px 3px 4px #7f7f7f;
right: 20px;
}
/* Footer */
#FooterContainer {
background: #272727;
color: #fff;
}
#FooterContainer li {
display: inline;
}
#FooterContainer input, #FooterContainer textarea {
display: block;
width: 100%;
}
#ContactNavigationContainer {
float: right;
}
#FooterRightColumn {
width: 40%;
float: right;
margin: 20px 150px 20px 50px;
}
#FooterRightColumn form {
margin-top: 20px;
padding: 15px 20px;
}
#FooterRightColumn input, #FooterRightColumn textarea {
margin: 5px;
box-shadow: inset 5px 5px 8px black;
border: none;
font-size: 16px;
background: #b3b3b3;
padding: 5px 10px;
}
#FooterRightColumn textarea {
height: 160px;
}
#FooterRightColumn .current_contact_option {
margin-right: 20px;
padding-right: 20px;
border-right: 1px solid #FFF;
color: #2e7de8;
font-weight: bold;
text-shadow: 0px 0px 5px #2e7de8;
}
#FooterLeftColumn {
width: 40%;
padding: 40px 50px;
margin-left: 100px;
margin-top: 20px;
}
#FooterLeftColumn h1 {
font-weight: bold;
font-size: 24px;
position: relative;
right: 20px;
}
#FooterLeftColumn p {
padding: 20px 0px;
text-indent: 1em;
}
.submit_button {
position: relative;
width: 80px;
float: right;
}
html:
<html>
<head>
<title>B.workshop Home</title>
<link rel="stylesheet" type="text/css" href="../css/reset.css" />
<link rel="stylesheet" type="text/css" href="../css/style.css" />
</head>
<body>
<div id="HeaderContainer">
<img src="../images/logo.png"></img>
<div id="NavigationContainer">
<ul id="NavigationMenu">
<li class="current_page">Home</li>
<li>Technologies</li>
<li>Projects</li>
</ul>
</div> <!-- Close NavigationContainer -->
</div> <!-- Close HeaderContainer -->
<div id="MainContent">
<div id="ContentRightColumn">
<h1>News</h1>
<div class="news_item">
<h3>Mon. October 28th</h3>
<p>I need to build a portfolio, you need a website or application. Until I I get a few jobs under the belt I'm offering to work at the equivalent of a paid interns wage. Take advantage of this while you can!</p>
</div>
<div class="news_item">
<h3>Mon. October 26th</h3>
<p>The website is now live!</p>
</div>
</div> <!-- Close RightColumn -->
<div id="ContentLeftColumn">
<h1>Welcome to Brett's Workshop...</h1>
<div class="content_item">
<h2>So who are you?</h1>
<p>Hi, my name is Brett Sprouse and you've found my homepage! I'm a freelance web developer and programmer. Take a look around and if you think you may have a project I can help you with then head over to the contact page and share it with me.</p>
</div>
<div class="content_item">
<h2>Ok, and what can you do for me?</h2>
<p>Well, I can make you a webpage of course. Not just that, but setup hosting, provide server maintenance, website support, both per job or on a contractual basis. I can likely also take over support for existing websites in addition to the one I may make from scratch.</p>
<p>Everything is coded to the current html specifications including html5 and css3 (when applicable, many browsers still do not support the current html5/css3 specifications). I said I'm a programmer as well so this means I can work my way around javascript for front end/client side interactivity as well as server side scripting preferentially with python though I can also use php if it's for some reason forced upon me.</p>
</div>
<div class="content_item">
<h2>Is that it?</h2>
<p>What do you mean is that it!? Ok, ok, I can also develop desktop applications, tools and utilities, or scripts to help automate otherwise monotonous tasks; pretty much anything within a programmers domain. I know quite a few languages, libraries, frameworks, and can learn new ones rather quickly. Both windows and linux so if there's a task you believe can be solved with programming I can likely make that happen for you. Do keep in mind however that I am only one guy so there is a limit to the size of projects in which I can handle, but if you're not sure it doesn't hurt to ask. </p>
</div>
</div> <!-- Close LeftColumn -->
</div> <!-- Close MainConent -->
<div id="FooterContainer">
<div id="FooterRightColumn">
<div id="ContactNavigationContainer">
<ul id="ContactNavigation">
<li class="current_contact_option">Message Form</li>
<li>Live Chat</li>
</ul>
</div> <!-- Close ContactNavigationContainer -->
<form>
<input type="text" value="Name" name="name"></input>
<input type="text" value="Email" name="email"></input>
<textarea type="text" value= "Message" name="message"></textarea>
<div class="submit_button"><input type="submit" value="submit"></input></div>
</form>
</div> <!-- Close FooterRightColumn -->
<div id="FooterLeftColumn">
<h1>Contact</h1>
<p>So you've looked me over and decided to give me a shot. Well you won't be let down. Just use the form on your right to send me a shot description and anything else you feel is necessary and I'll get back to you shortly with a proposal. If you've happened to catch me when I'm on the computer and would like to talk directly feel free to use the new live chat system!</p>
</div> <!-- Close FooterLeftColumn -->
<div class="clear_both"></div>
</div> <!-- Close FooterContainer -->
</body>
</html>
This is just an issue regarding specificity - you just need to be more specific than the initial declaration.
No need for !important, just use the following:
#FooterRightColumn .submit_button input {
box-shadow: none;
}
jsFiddle example - it works.
Initially, you were added the shadow via #FooterRightColumn input. Simply be more specific by targeting #FooterRightColumn .submit_button input instead.