Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS How to position footer out of nav

Tuck3rB

New Coder
I have created a basic encyclopedia page for a project. I wanted to code this page with correct formatting and then base all of my other entries off of it. I am having trouble, however, getting my footer out of the left nav bar. I want the footer to be on the bottom after everything else.

Also, I would like the image to be to the right of the paragraph text. I cannot figure out how to get the image to wrap the paragraph within the <article>.

Here's the HTML code

HTML:
<!DOCTYPE html>
<html>
    <head>
        <title>TITLE | Encyclopedia</title>
        <link rel="StyleSheet" href="style_basic_page.css">
        <link rel="icon" type="/x-icon" href="/EncOzk.jpg">
    </head>
    <header>
        <center><a href="/index_en.html" class="homepage_link"><h1>ENCYCLOPEDIA</h1></a></center>
    </header>
      <nav>
          <br><a href="index_en.html">Home</a><br>
          <br><a>Culture and the Arts</a><br>
          <br><a>Geography and Places</a><br>
          <br><a>History and Events</a><br>
          <br><a>People and Groups</a><br>
          <br><a>Religion and Beliefs</a><br>
          <br><a>Technology and Architecture</a>
      </nav>
    <body>
      <article>
            <p class="title">TITLE</p>
            <div>
                <img src="TitlePage.PNG"; width= 300px; float= right;>
                <p>PARAGRAPH TEXT</p>
            </div>
      </article>
    </body>
    <footer>
      <p>FOOTER TEXT</p>
    </footer>
</html>

and my CSS styling

CSS:
h1, h2 {
    text-align: center;
    display: inline;
}
.title {
    font-size: 30px;
    border-width: thin;
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: solid;
    border-left-style: none;
}
header {
    border-width: medium;
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: double;
    border-left-style: none;
}
.homepage_link {
    color: black;
    text-decoration: none;
}
nav {
    float: left;
    width: 20%;
    border-width: thin;
    border-top-style: none;
    border-right-style: solid;
    border-bottom-style: none;
    border-left-style: none;
}
article {
  float: right;
  width: 79%;
}
br {
  display: block;
  margin-bottom: 9px;
  font-size:2px;
  line-height: 2px;
}
 
Hiya, The issue you had here was the footer had no real width so it was sliding in where it could fit :D I have now given it a 100% width and floated:left and it sits where it should, i have also fixed your body tags :D

CSS:
h1, h2 {
    text-align: center;
    display: inline;
}
.title {
    font-size: 30px;
    border-width: thin;
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: solid;
    border-left-style: none;
}
header {
    border-width: medium;
    border-top-style: none;
    border-right-style: none;
    border-bottom-style: double;
    border-left-style: none;
}
.homepage_link {
    color: black;
    text-decoration: none;
}
nav {
    float: left;
    width: 20%;
    border-width: thin;
    border-top-style: none;
    border-right-style: solid;
    border-bottom-style: none;
    border-left-style: none;
}
article {
  float: right;
  width: 79%;
}
br {
  display: block;
  margin-bottom: 9px;
  font-size:2px;
  line-height: 2px;
}

footer {
  width:100%;
  float:left;
  text-align:center;
}

HTML:
<!DOCTYPE html>
<html>
    <head>
        <title>TITLE | Encyclopedia</title>
        <link rel="StyleSheet" href="style_basic_page.css">
        <link rel="icon" type="/x-icon" href="/EncOzk.jpg">
    </head>
    <body>
    <header>
        <center><a href="/index_en.html" class="homepage_link"><h1>ENCYCLOPEDIA</h1></a></center>
    </header>
      <nav>
          <br><a href="index_en.html">Home</a><br>
          <br><a>Culture and the Arts</a><br>
          <br><a>Geography and Places</a><br>
          <br><a>History and Events</a><br>
          <br><a>People and Groups</a><br>
          <br><a>Religion and Beliefs</a><br>
          <br><a>Technology and Architecture</a>
      </nav>
      <article>
            <p class="title">TITLE</p>
            <div>
                <img src="TitlePage.PNG"; width= 300px; float= right;>
                <p>PARAGRAPH TEXT</p>
            </div>
      </article>
      <footer>
        <p>FOOTER TEXT</p>
      </footer>
    </body>
</html>
 

Latest posts

Buy us a coffee!

Back
Top Bottom