How should I do to put a leaning element at the bottom

Questions and tutorials related to Cascading Style Sheets *all versions*

Moderators: egami, macek, gesf

Post Reply
User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 728
Joined: Mon Feb 22, 2016 5:52 pm

Wed Jun 22, 2016 4:17 pm

Code: Select all

ection {
   border: 1px solid #000;
   height: 100px;
   margin: 20px auto;
   width: 400px;
}
Should read

Code: Select all

section {
   border: 1px solid #000;
   height: 100px;
   margin: 20px auto;
   width: 400px;
}
The <hr> should not be needed.

Since you are using the new html 5 elements, you should be using <footer> and not <p>, along with a correct doctype

Code: Select all

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>My Website</title>
</head>
</body>
<section>
  <h1>The main signboard</h1>
  <p>This is my content</p>
<section>

<footer>
  <p>footer signboard</p>
</footer>
</body>
</html>

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 728
Joined: Mon Feb 22, 2016 5:52 pm

Thu Jun 23, 2016 12:41 pm

You have posted in the css part of the forum, that is what you need to learn if you want to adjust the display of your html.

Often it is a better idea to have a bit more content to work with when designing a page layout. By trying to get your footer how you want it first is probably not a good idea.

User avatar
hyper
php-forum Fan User
php-forum Fan User
Posts: 728
Joined: Mon Feb 22, 2016 5:52 pm

Fri Jun 24, 2016 9:14 am

You have six elements in your code:

Code: Select all

html
body
section
h1
hr
& p
You need to learn what your css does otherwise you will constantly be asking for a bit up and bit down a bit left etc.......

Is your site only going to consist of content in h1 and p elements?

Post Reply