Move picture to right of page - html

I need some expert help!
I'm trying to move a picture to the right of a div, but when I "float: right;" the picture just moves out of the initial div that it is in. The div that the image keeps moving out of is the "daily-reading" div, and for some reason, I just can't get it to the right without it leaving that div. I am trying to get the picture to sit to the right of my paragraphs, as the paragraphs are right where I need them. Anybody who can help will be greatly appreciated!
Here's my code:
(Starting off at the div we are looking at)
body {
padding: 0;
margin: 0;
font-family: 'Josefin Sans', sans-serif;
}
#main-slider {
height: 100%;
width: 100%;
}
.main-menu-list {
color: white;
float: right;
padding-left: 7px;
position: relative;
bottom: 640px;
}
#menu-contact {
margin-right: 7px;
}
#daily-reading {
background-color: #F0F1F2;
position: relative;
bottom: 22px;
}
#daily-reading-heading {
text-align: center;
margin-left: 185px;
padding: 10px 0 1px;
}
#daily-post p {
width: 600px;
margin-left: 10px;
}
#daily-post-picture {
}
#daily-post-picture img {
height: 200px;
}
<div id="daily-reading">
<h1 id="daily-reading-heading">Today's Reading</h1>
<div id="daily-post">
<p>For we are God’s workmanship, created in Christ Jesus to do good works, which God prepared for us in advance to do. –Ephesians 2:10
<p>Consider the following quote:</p>
<p>"I am only one, but I am one;
I cannot do everything
But I can do something.
What I can do, I ought to do
And what I ought to do
By the grace of God, I will do."
– Canon Farrar</p>
<p>We live in a culture that constantly shines a spotlight on the famous: pretty or especially gifted people (or both!) We live in a celebrity-focused culture. Just think about all of the media devoted to celebrities. It would be great if the church was immune from this culture, but it isn’t. Even the Christian community tends to highlight our best people; from musicians to speakers, to those involved in doing incredible ministry. While I’m not saying that spotlighting is wrong, I am concerned that there are many of us who become disheartened because we know our efforts don’t approach the skills or successes of those of the extremely gifted. I am concerned that some of us give up attempting to make a difference when we think we can’t measure up.</p>
<p>True, we may never be celebrities in the eyes of the world or even within the Christian community. But, God doesn’t call us to be famous. He calls us to love one another. He calls us to give ourselves away to serve others. The needs of our world are great, and we cannot do everything. Still, as part of the body of Christ, we have a unique and invaluable role to play. God has purposely designed us for accomplishing good works in His name.</p>
<p>Stop playing the comparison game. Anyone who plays that game loses. There will always be someone else who does things better or is more effective. We are called to serve the Lord. Our desire should be solely to please Him. Serve Him today to the best of your abilities. Your service will be a sacrifice of praise to the King.</p>
<div id="daily-post-picture">
<img src="https://placehold.it/100">
</div>
</div>
</div>

Move the div #daily-post-picture above the paragraphs and apply float:right;
body {
padding: 0px;
margin: 0px;
font-family: 'Josefin Sans', sans-serif;
}
#main-slider {
height: 100%;
width: 100%;
}
.main-menu-list {
color:white;
float: right;
padding-left: 7px;
position: relative;
bottom: 640px;
}
#menu-contact {
margin-right:7px;
}
#daily-reading {
background-color: #F0F1F2;
position: relative;
bottom: 22px;
}
#daily-reading-heading {
text-align: center;
margin-left: 185px;
padding: 10px 0 1px 0;
}
#daily-post p {
width: 600px;
margin-left: 10px;
}
#daily-post-picture {
float: right;
margin: 0 0 20px 20px;
}
#daily-post-picture img {
height: 200px;
}
<div id="daily-reading">
<h1 id="daily-reading-heading">Today's Reading</h1>
<div id="daily-post-picture" style="float:right">
<img src="photos/bible-reading.jpg">
</div>
<div id="daily-post">
<p>For we are God’s workmanship, created in Christ Jesus to do good works, which God prepared for us in advance to do. –Ephesians 2:10
<p>Consider the following quote:</p>
<p>"I am only one, but I am one;
I cannot do everything
But I can do something.
What I can do, I ought to do
And what I ought to do
By the grace of God, I will do."
– Canon Farrar</p>
<p>We live in a culture that constantly shines a spotlight on the famous: pretty or especially gifted people (or both!) We live in a celebrity-focused culture. Just think about all of the media devoted to celebrities. It would be great if the church was immune from this culture, but it isn’t. Even the Christian community tends to highlight our best people; from musicians to speakers, to those involved in doing incredible ministry. While I’m not saying that spotlighting is wrong, I am concerned that there are many of us who become disheartened because we know our efforts don’t approach the skills or successes of those of the extremely gifted. I am concerned that some of us give up attempting to make a difference when we think we can’t measure up.</p>
<p>True, we may never be celebrities in the eyes of the world or even within the Christian community. But, God doesn’t call us to be famous. He calls us to love one another. He calls us to give ourselves away to serve others. The needs of our world are great, and we cannot do everything. Still, as part of the body of Christ, we have a unique and invaluable role to play. God has purposely designed us for accomplishing good works in His name.</p>
<p>Stop playing the comparison game. Anyone who plays that game loses. There will always be someone else who does things better or is more effective. We are called to serve the Lord. Our desire should be solely to please Him. Serve Him today to the best of your abilities. Your service will be a sacrifice of praise to the King.</p>
</div>
</div>

you just try this
<!DOCTYPE html>
<html>
<head>
<title>stack</title>
</head>
<body>
<div id="daily-reading">
<h1 id="daily-reading-heading">Today's Reading</h1>
<div id="daily-post">
<div id="daily-post-picture">
<img src="photos/bible-reading.jpg">
</div>
<div id="daily-post-content">
<p>For we are God’s workmanship, created in Christ Jesus to do good works, which God prepared for us in advance to do. –Ephesians 2:10
<p>Consider the following quote:</p>
<p>"I am only one, but I am one;
I cannot do everything
But I can do something.
What I can do, I ought to do
And what I ought to do
By the grace of God, I will do."
– Canon Farrar</p>
<p>We live in a culture that constantly shines a spotlight on the famous: pretty or especially gifted people (or both!) We live in a celebrity-focused culture. Just think about all of the media devoted to celebrities. It would be great if the church was immune from this culture, but it isn’t. Even the Christian community tends to highlight our best people; from musicians to speakers, to those involved in doing incredible ministry. While I’m not saying that spotlighting is wrong, I am concerned that there are many of us who become disheartened because we know our efforts don’t approach the skills or successes of those of the extremely gifted. I am concerned that some of us give up attempting to make a difference when we think we can’t measure up.</p>
<p>True, we may never be celebrities in the eyes of the world or even within the Christian community. But, God doesn’t call us to be famous. He calls us to love one another. He calls us to give ourselves away to serve others. The needs of our world are great, and we cannot do everything. Still, as part of the body of Christ, we have a unique and invaluable role to play. God has purposely designed us for accomplishing good works in His name.</p>
<p>Stop playing the comparison game. Anyone who plays that game loses. There will always be someone else who does things better or is more effective. We are called to serve the Lord. Our desire should be solely to please Him. Serve Him today to the best of your abilities. Your service will be a sacrifice of praise to the King.</p>
</div>
</div>
</div>
</body>
</html>
<style type="text/css">
body {
padding: 0px;
margin: 0px;
font-family: 'Josefin Sans', sans-serif;
}
#main-slider {
height: 100%;
width: 100%;
}
.main-menu-list {
color:white;
float: right;
padding-left: 7px;
position: relative;
bottom: 640px;
}
#menu-contact {
margin-right:7px;
}
#daily-reading {
background-color: #F0F1F2;
position: relative;
bottom: 22px;
}
#daily-reading-heading {
text-align: center;
margin-left: 185px;
padding: 10px 0 1px 0;
}
#daily-post p {
width: 600px;
margin-left: 10px;
}
#daily-post-picture {
float: left;
width: 50%;
}
#daily-post-content{
float: right;
width: 50%;
}
#daily-post-picture img {
height: 200px;
}
</style>

Instead of changing the position of image.You can apply position:absolute to it
check this snippet
body {
padding: 0;
margin: 0;
font-family: 'Josefin Sans', sans-serif;
}
#main-slider {
height: 100vh;
width: 100vw;
}
#menu-contact {
margin-right: 7px;
}
#daily-reading {
background-color: #F0F1F2;
position: relative;
bottom: 22px;
}
#daily-reading-heading {
text-align: center;
margin-left: 185px;
padding: 10px 0 1px;
}
#daily-post p {
width: 600px;
margin-left: 10px;
}
#daily-post-picture {} #daily-post-picture img {
position: absolute;
top: 0;
right: 0;
}
<div id="daily-reading">
<h1 id="daily-reading-heading">Today's Reading</h1>
<div id="daily-post">
<p>For we are God’s workmanship, created in Christ Jesus to do good works, which God prepared for us in advance to do. –Ephesians 2:10
<p>Consider the following quote:</p>
<p>"I am only one, but I am one; I cannot do everything But I can do something. What I can do, I ought to do And what I ought to do By the grace of God, I will do." – Canon Farrar</p>
<p>We live in a culture that constantly shines a spotlight on the famous: pretty or especially gifted people (or both!) We live in a celebrity-focused culture. Just think about all of the media devoted to celebrities. It would be great if the church
was immune from this culture, but it isn’t. Even the Christian community tends to highlight our best people; from musicians to speakers, to those involved in doing incredible ministry. While I’m not saying that spotlighting is wrong, I am concerned
that there are many of us who become disheartened because we know our efforts don’t approach the skills or successes of those of the extremely gifted. I am concerned that some of us give up attempting to make a difference when we think we can’t
measure up.</p>
<p>True, we may never be celebrities in the eyes of the world or even within the Christian community. But, God doesn’t call us to be famous. He calls us to love one another. He calls us to give ourselves away to serve others. The needs of our world
are great, and we cannot do everything. Still, as part of the body of Christ, we have a unique and invaluable role to play. God has purposely designed us for accomplishing good works in His name.</p>
<p>Stop playing the comparison game. Anyone who plays that game loses. There will always be someone else who does things better or is more effective. We are called to serve the Lord. Our desire should be solely to please Him. Serve Him today to the
best of your abilities. Your service will be a sacrifice of praise to the King.</p>
<div id="daily-post-picture">
<img src="https://placehold.it/100">
</div>
</div>
</div>

Related

The "left" tag works but the top only works when i set it as px and doesnt when i set as % [duplicate]

This question already has answers here:
Setting CSS top percent not working as expected
(4 answers)
Closed 3 years ago.
When trying to set the distance of the paragraph from the top of the page it only works when its set as a pixel value and not when i set it as %. It somehow works with left though
I've tried the % but hasn't worked
.para1 {
font-family: sans-serif;
font-size: 12px;
letter-spacing: 1px;
color: white;
border: none;
position: relative;
display: inline-block;
max-width: 70%;
top: 30%;
left: 9%;
margin: 0 auto;
text-align: left;
}
<div class="para1">
<p>If you're reading this I just would like to say a huge thank you for taking the time to want to know who's behind UnixCast. I'm a full-time student with a big passion for learning. I enjoy studying physics and hope to get a degree in astrophysics sometime
in the future. I've always had a passion for creating content online. From when YouTube was at the start of its big popularity boom, I fell in love with the idea of sharing content freely for everyone to see. My goals for my content are simple:
</p>
</div>
Expected results are to get the text to be responsive to whatever top % I give.
Well because your <div> needs a height. And the rest of your css has to be for the <p> not the <div>.
Example
.para1{
position: relative;
height: 200px;
}
p {
top: 80%;
left: 9%;
margin: 0 auto;
text-align: left;
border: none;
position: relative;
display: inline-block;
max-width: 70%;
font-family: sans-serif;
font-size: 12px;
letter-spacing: 1px;
}
<div class="para1">
<p>If you're reading this I just would like to say a huge thank you for taking the time to want to know who's behind UnixCast. I'm a full-time student with a big passion for learning. I enjoy studying physics and hope to get a degree in astrophysics sometime in the future. I've always had a passion for creating content online. From when YouTube was at the start of its big popularity boom, I fell in love with the idea of sharing content freely for everyone to see. My goals for my content are simple:
</p>
</div>
Here is my fiddle
Update
New fiddle

Align an image next to a paragraph

I am trying to get to perfectly align a paragraph next to a text but I am struggling, can anyone help? Here is what I have:
#aboutme {
padding: 50px;
}
#aboutme img {
border-radius: 50%;
width: 150px;
vertical-align: middle;
}
#aboutme p {
font-size: 16px;
display: table-cell;
color: #212529;
}
.intro_link {
text-decoration: none;
color: #4a69bd;
}
.intro_link:hover {
color: red;
}
<section id="aboutme">
<div class="container">
<img src="./img/face.png">
<p>Welcome to my personal website! In here, you will find out everything about me. You can scroll down to discover more about my portfolio, my weekly activities or ways to contact me. Before doing so, I shall briefly introduce myself! I am a 20 year
old student studying at Concordia University in Montreal. Currently, I am in my 2nd year of education pursuing a Bachelors in Software Engineering. Up to now, my experience has been wonderful. I meet great people that share similar interests, my
network is growing day-by-day and I learn things that interest me. The ultimate goal right now is to graduate and this website will be used to explore everything I learn as I go. For my school assignments and personal projects, you can find them
in the portfolio section. If you are ever interested in checking out my other social etworks (GitHub, LinkedIn, etc...) or to contact me, you can go to the contacts section.
</p>
</div>
</section>
I would like to nicely align the paragraph and the image to make it nice and central but I am struggling to understand the properties, I started learning HTML & CSS yesterday
#aboutme{
padding: 50px;
}
#aboutme img{
border-radius: 50%;
width: 150px;
vertical-align: middle;
float:left;
padding: 0px 10px 10px 0px;
}
/*#aboutme p{
font-size: 16px;
display: table-cell;
color: #212529;
}*/
.intro_link{
text-decoration: none;
color: #4a69bd;
}
.intro_link:hover{
color: red;
}
<section id="aboutme">
<div class="container">
<img src="https://vignette.wikia.nocookie.net/fan-fiction-library/images/1/15/Admin.png/revision/latest?cb=20140917130743">
<p>Welcome to my personal website! In here, you will find out everything about me. You can scroll down to discover more about my portfolio,
my weekly activities or ways to contact me. Before doing so, I shall briefly introduce myself! I am a 20 year old student studying at Concordia University in Montreal. Currently, I am in my
2nd year of education pursuing a Bachelors in Software Engineering. Up to now, my experience
has been wonderful. I meet great people that share similar interests, my network is growing day-by-day
and I learn things that interest me. The ultimate goal right now is to graduate and this website will
be used to explore everything I learn as I go. For my school assignments and personal projects, you can find
them in the portfolio section. If you are ever interested in checking out my other social
etworks (GitHub, LinkedIn, etc...) or to contact me, you can go to the contacts section.
</p>
</div>
</section>
You can use flex to achieve this
Set display: flex to .container
Use align-items: start in .container so that the image will not
get stretched
Add margin-right to #aboutme img for spacing between image and
paragraph
#aboutme{
padding: 50px;
}
#aboutme img{
border-radius: 50%;
width: 150px;
vertical-align: middle;
margin-right: 10px;
}
#aboutme p{
font-size: 16px;
display: table-cell;
color: #212529;
}
.intro_link{
text-decoration: none;
color: #4a69bd;
}
.intro_link:hover{
color: red;
}
.container {
display: flex;
align-items: start;
}
<section id="aboutme">
<div class="container">
<img src="http://via.placeholder.com/500x500">
<p>Welcome to my personal website! In here, you will find out everything about me. You can scroll down to discover more about my portfolio,
my weekly activities or ways to contact me. Before doing so, I shall briefly introduce myself! I am a 20 year old student studying at Concordia University in Montreal. Currently, I am in my
2nd year of education pursuing a Bachelors in Software Engineering. Up to now, my experience
has been wonderful. I meet great people that share similar interests, my network is growing day-by-day
and I learn things that interest me. The ultimate goal right now is to graduate and this website will
be used to explore everything I learn as I go. For my school assignments and personal projects, you can find
them in the portfolio section. If you are ever interested in checking out my other social
etworks (GitHub, LinkedIn, etc...) or to contact me, you can go to the contacts section.
</p>
</div>
</section>

DIV Falling Off Screen In Internet Explorer

This is my first time here, so please go easy on me. I have been doing coding at university for a couple of months now in one of my modules, and am just finishing off a project and beginning to test it on different browsers. It all runs fairly smoothly apart for one page on Internet Explorer.
On the image below, you'll see that the text that is supposed to go underneath the 'Public Observing' and 'Meetings' section shifts to the edge of the screen and falls off in Internet Explorer.
I've been googling for over an hour now with no luck, I was hoping some of you geniuses will be able to assist me!
Here is some of my HTML and CSS regarding those elements. Thank you very much for shedding any light on this issue!
.observing {
text-align: left;
font-size: 30px;
width: 21%;
padding-bottom: 2%;
}
.observingp {
text-align: left;
font-size: 17px;
width: 40%;
align-content: left;
float: left;
}
.meetings {
text-align: left;
font-size: 30px;
width: 21%;
padding-bottom: 2%;
margin-left: 42.5%;
margin-top: -5%;
}
.meetingsp {
text-align: left;
font-size: 17px;
width: 30%;
align-content: left;
float: left;
margin-left: 3%;
}
<div id="activities-info">
<div id="public-observing">
<h4 class="observing">Public Observing</h4>
<p1 class="observingp">
Public Observing takes place at ‘The New Inn’ at Eccup (LS168AU). Sessions are held regularly during most months, however they stop over Summer when the sunset is too late. Start times vary according to the sunset, and inconsistent dates are due to avoiding
the full moon, which makes observing difficult.
<br><br> Please dress warmly, as observing takes place on an open field. Also, ensure that all children are supervised by a responsible adult. The Society cannot be responsible for accidents on the field.
</p1>
</div>
<div id="meetings">
<h4 class="meetings">Meetings</h4>
<p1 class="meetingsp">
Meetings are held on the second Wednesday of each month at the Quaker Meeting House (LS29DX) between 7pm and 10pm. Meetings usually involve a lecture or presentation of an astronomical topic given by guest speakers or society members. <br><br> Informal
meetings take place two weeks later, on Wednesdays. Here members have an opportunity to express and discuss their interests with personal presentations.
</p1>
</div>
</div>
i recommend to use normalize.css - it is a project to make all borwsers render pages consistently. Just include it as another css befoer your own css file and you will have silmilar results on all browsers.
https://necolas.github.io/normalize.css/

Wrapping Text Around Images (Responsive)

Good Evening,
I have tried and tried to position my text to the right of an image and when the browser is smaller then drops down underneath the image.
Can somebody tell me what I am doing wrong or not doing.
#bandmemberinfo-container {
width: 100%;
background-color: black;
height: auto;
margin-top: 10px;
border: 1px red solid;
color: #fff;
font-family: Arial;
font-size: 10px;
text-transform: uppercase;
}
.bandmemberinfo-container img {
height: 100%;
max-width: 350px;
float: left;
}
<div id="bandmemberinfo-container">
<!-- BAND MEMBER INFO CONTAINER START -->
<img src="http://slade40years.page4.com/nobby_439_752.jpg" class="img-responsive nobbyboulder" />
<p>THE 1970'S HOSTED ONE OF THE MOST FLAMBOYANT DECADES IN THE HISTORY OF POP MUSIC AND ARTISTS SUCH AS SWEET, DAVID BOWIE, WIZZARD, T-REX AND MUD CHAMPIONED THE "GLAM ROCK" MOVEMENT, WHERE PLATFORM BOOTS, SEQUINNED SHIRTS, TWO-TONE FLARED TROUSERS AND
OUTRAGEOUS MAKE-UP, BECAME THE NORM FOR MANY POP BANDS. THE MIGHTY SLADE LED THE GLAM MARCH ACROSS THE UK, INTO EUROPE AND THROUGHOUT THE WORLD. IT IS A PART OF POP HISTORY THAT HAS SHAPED MUSIC CULTURE MANY YEARS LATER AND SLYDE CONTINUE TO KEEP
THE EXCITING ATMOSPHERE OF GLAMROCK ALIVE. THEY ARE THE PERFECT CHOICE FOR ANY 70'S THEMED EVENT WITH AN IMPRESSIVE STAGE SHOW DURING WHICH THEY COVER MANY OF THE CLASSIC HITS OF THAT ERA SLYDE HAVE SUPPORTED ARTISTS SUCH AS THE RUBETTES, BAY CITY
ROLLERS, SMOKIE, BONEY M AND THE LATE ALVIN STARDUST. THEY ARE THE LONGEST RUNNING TRIBUTE TO THE MUSIC OF SLADE AND HAVE PERFORMED WITH THEM AT 70'S WEEKENDERS, UNDER THE NAME OF GLAMROCK UK.</p>
<!-- BAND MEMBER INFO CONTAINER END-->
</div>
You are using a class selector that is not in your HTML
Use:
#bandmemberinfo-container img {
height: 100%;
max-width: 350px;
float: left;
}
or add "bandmemberinfo-container" class not id (http://www.w3schools.com/css/css_syntax.asp ;)
You have two little mistakes:
1.) The selector for the image has to be #bandmemberinfo-container img instead of .bandmemberinfo-container img
2.) Its CSS settings should be like this:
#bandmemberinfo-container img {
width: 100%;
max-width: 350px;
float: left;
}
I.e. 100% width not height) for small screens (below 350px wide), but with a maximum of 350px - then the text will float right of it on larger screens (above 350px).
#bandmemberinfo-container {
width: 100%;
background-color: black;
height: auto;
margin-top: 10px;
border: 1px red solid;
color: #fff;
font-family: Arial;
font-size: 10px;
text-transform: uppercase;
}
#bandmemberinfo-container img {
width: 100%;
max-width: 350px;
float: left;
}
<div id="bandmemberinfo-container">
<!-- BAND MEMBER INFO CONTAINER START -->
<img src="http://slade40years.page4.com/nobby_439_752.jpg" class="img-responsive nobbyboulder" />
<p>THE 1970'S HOSTED ONE OF THE MOST FLAMBOYANT DECADES IN THE HISTORY OF POP MUSIC AND ARTISTS SUCH AS SWEET, DAVID BOWIE, WIZZARD, T-REX AND MUD CHAMPIONED THE "GLAM ROCK" MOVEMENT, WHERE PLATFORM BOOTS, SEQUINNED SHIRTS, TWO-TONE FLARED TROUSERS AND
OUTRAGEOUS MAKE-UP, BECAME THE NORM FOR MANY POP BANDS. THE MIGHTY SLADE LED THE GLAM MARCH ACROSS THE UK, INTO EUROPE AND THROUGHOUT THE WORLD. IT IS A PART OF POP HISTORY THAT HAS SHAPED MUSIC CULTURE MANY YEARS LATER AND SLYDE CONTINUE TO KEEP
THE EXCITING ATMOSPHERE OF GLAMROCK ALIVE. THEY ARE THE PERFECT CHOICE FOR ANY 70'S THEMED EVENT WITH AN IMPRESSIVE STAGE SHOW DURING WHICH THEY COVER MANY OF THE CLASSIC HITS OF THAT ERA SLYDE HAVE SUPPORTED ARTISTS SUCH AS THE RUBETTES, BAY CITY
ROLLERS, SMOKIE, BONEY M AND THE LATE ALVIN STARDUST. THEY ARE THE LONGEST RUNNING TRIBUTE TO THE MUSIC OF SLADE AND HAVE PERFORMED WITH THEM AT 70'S WEEKENDERS, UNDER THE NAME OF GLAMROCK UK.</p>
<!-- BAND MEMBER INFO CONTAINER END-->
</div>
I think for what your desired effect is. You can put the image inside the paragraph tag as the first item before the text starts, then the text will wrap around the image. You can then just add margin to the image to give it extra space between the image and text. And possibly use the image align-attribute
I have added another more heavy html element approach below, to show another method to control a layout. This is using floats and a more responsive approach.
I would also avoid using ID; use class as a rule of thumb. As it is just one less think to think about. And, if you don't care about legacy (IE) browsers then you could consider to use Flexbox. Which will help with different screens and wrapping of images.
.bandmemberinfo-container {
display: inline-flex;
width: 100%;
background-color: black;
height: auto;
margin-top: 1em;
border: 1px red solid;
color: #fff;
font-family: Arial;
font-size: 0.9em;
text-transform: uppercase;
}
.img_wrap {
float: left;
width: 50%;
border: 1px yellow dashed;
}
.img_wrap img {
height: auto;
max-width: 100%;
}
.two {
float: left;
width: 50%;
}
<div class="bandmemberinfo-container">
<div class='img_wrap'><img src="http://slade40years.page4.com/nobby_439_752.jpg" /></div>
<div class='two'>THE 1970'S HOSTED ONE OF THE MOST FLAMBOYANT DECADES IN THE HISTORY OF POP MUSIC AND ARTISTS SUCH AS SWEET, DAVID BOWIE, WIZZARD, T-REX AND MUD CHAMPIONED THE "GLAM ROCK" MOVEMENT, WHERE PLATFORM BOOTS, SEQUINNED SHIRTS, TWO-TONE FLARED TROUSERS AND
OUTRAGEOUS MAKE-UP, BECAME THE NORM FOR MANY POP BANDS. THE MIGHTY SLADE LED THE GLAM MARCH ACROSS THE UK, INTO EUROPE AND THROUGHOUT THE WORLD. IT IS A PART OF POP HISTORY THAT HAS SHAPED MUSIC CULTURE MANY YEARS LATER AND SLYDE CONTINUE TO KEEP
THE EXCITING ATMOSPHERE OF GLAMROCK ALIVE. THEY ARE THE PERFECT CHOICE FOR ANY 70'S THEMED EVENT WITH AN IMPRESSIVE STAGE SHOW DURING WHICH THEY COVER MANY OF THE CLASSIC HITS OF THAT ERA SLYDE HAVE SUPPORTED ARTISTS SUCH AS THE RUBETTES, BAY CITY
ROLLERS, SMOKIE, BONEY M AND THE LATE ALVIN STARDUST. THEY ARE THE LONGEST RUNNING TRIBUTE TO THE MUSIC OF SLADE AND HAVE PERFORMED WITH THEM AT 70'S WEEKENDERS, UNDER THE NAME OF GLAMROCK UK.</p></div>
<!-- BAND MEMBER INFO CONTAINER END-->
</div>

HTML -> Fixed top, Fixed bottom and dynamic content

i would like to create a single page where:
1) The top, 100px, fixed
2) The bottom, 100px, fixed
3) Between top and bottom there is dynamic content
I was able to create exactly that but i have an issue, when i am scrolling the dynamic content, the elements go under and over the top and bottom and the same elements are visible thru the fixed top/bottom.
I tried clear: both; on the top and bottom div, but since they are fixed, the clear: both; did'nt works.
I would like to keep the dynamics elements inside the content div between top and bottom and if possible still use the main document scroll bar to scroll inside it.
Here is an example, assume the lines represent the top and bottom fixed div, and the 'element' are the dynamic contents.
element - not correct
element - not correct
element
element
element
element
element
element - not correct
element - not correct
Hope i am clear enough and thanks in advance!
I guess this is what you're looking for.
See this fiddle.
HTML
<header>
This is the header!
</header>
<article>
<p>Goodness one unimaginative rooster some that circa much jay goodness gosh pessimistic scantly dark some modest gasped where unexplainable some before about that a hello firefly macaw ethereally indecisive panda lorikeet where a peskily jellyfish a since lied factiously in and that after but falteringly so worm flabbily yet hey gladly more versus much precarious because a the boisterous quiet fed one alas hawk flawlessly thanks some.</p>
<p>Squirrel much krill regarding before contrary jeez outdid warthog immaturely articulately valiant hey suggestive thus far won darn wow scorpion portentously more hotly miraculous jeepers meagerly since excluding that however pinched yet whale adoringly floppy tenably wow and after via for unproductively as one prior the more on urchin rang much because some more approving near oh a as far lion some lucky far much frog far and beneath underlay far after nosy jaguar subconscious after this far input frequently distant the much positively gagged jeez unobtrusively far sank less before babbled far by when this the this sensible outside.</p>
<p>That far qualitatively intrepid vulture a ferret disgraceful moaned therefore easy much and curt insincerely dachshund notwithstanding yikes and dragonfly and patted until much jeez close fumed divisive copiously wherever near near far perceptible shrewdly ground yikes opened as elaborate adversely spilled that creepy imaginative by in hello groundhog magnificently jeez hence crud versus desperately caterpillar checked one wicked far some yikes.</p>
<p>And darn dependent that urchin upon much jeez ably sniffed a less in far darn far incorrect between inept caterpillar man-of-war manta hence ironically into more amenable negative sanctimoniously tortoise eagle far spoiled clapped tepid yikes irresistibly testy warthog hugged immense much immense alas thus paid therefore agitatedly about well following the hey aboard and that after and condescending seagull because alas slept hey this went dove far much far considering raccoon witless under ungraceful.</p>
<p>Emptied much gosh circuitously inside along a far pointed fanatic hey bravely with far yikes capybara meadowlark sedulous some lion squid floated darn drolly underwrote loving spat maliciously coaxing unwilling goodness seagull elephant snickered balked sloth for kookaburra inside untactfully so the where much human then because pungently cracked heard overtook firm skeptically reverently much some jeez less and hey towards.</p>
</article>
<footer>
This is the footer!
</footer>
CSS
body {
font-family: sans-serif;
}
header, footer {
position: fixed;
height: 100px;
text-align: center;
width: 100%;
background: #ff0450;
color: #fff;
text-transform: uppercase;
line-height: 6em;
}
header {
top: 0;
}
footer {
bottom: 0;
}
article {
margin: 100px 50px 0;
}
article p {
margin: 20px 0;
}
article p:first-line {
font-variant: small-caps;
}
Update
body {
font-family: sans-serif;
}
header, footer {
position: fixed;
height: 100px;
text-align: center;
width: 100%;
background: #ff0450;
color: #fff;
text-transform: uppercase;
line-height: 6em;
}
header:before {
content: "";
position: absolute;
height: 20px;
background: #fff;
z-index: 999;
top: -20px;
width: 100%;
left: 0;
}
footer:before {
content: "";
position: absolute;
height: 20px;
background: #fff;
z-index: 999;
bottom: -20px;
width: 100%;
left: 0;
}
header {
top: 0;
margin-top: 20px;
}
footer {
bottom: 0;
margin-bottom: 20px;
}
article {
margin: 120px 50px 0;
}
article p {
margin: 20px 0;
}
article p:first-line {
font-variant: small-caps;
}
Updated the fiddle too.
here, take a look at this.
http://jsfiddle.net/PxabT/47/
update
http://jsfiddle.net/R4SV5/7/
Give the top and bottom elements a background-color or background image. Also it is probably a good idea to give top and bottom a z-index of 3 or higher.