(Solved)How to align paragraph and its header and give both of them a maximum width?

(Solved)How to align paragraph and its header and give both of them a maximum width?
0

#1

As the title said how can I align a paragraph and its header.
Here is an example.
my code

Here is what I wanna achieve.


#2

for the width i would either make your width 100% or add the bootstrap class "container-fluid’, you would do this in the css as body{width:100%;} or . not sure what or where you wanted to align too but you could use a simple style in your css of text-align: and then what ever direction you wanted, im guessing center. body{ text-align: center;} or h1{ text-align:center;} p{text-align: center;} Good luck and keep up the hard work. Youre at a very fun time where you are just starting to create real tangible sites. The World Is Yours


#3

What I wanted to do was to make the header and the <p> elements have the same width.
Like in this pic, I want both of them start and end at those red lines.


#4

in .section change margin to "0 auto"
and delete max-width from .section_content and add it to .section


#5

Oh, wow. It was that easy.

Thanks!!!


#6

Then what if I want to add a background color that colors the whole width to it???

eg:


#7

add the background-color to the body element.


#8

I just want the background color to show on a part of the website…
Just like this one: http://www.n3rdfusionstudios.com/


#9
<header>
<p class="section_header">We are the world's most influential video game broadcasting<br>company</p>
</header>
header {
background-color: #eee;
}
.section_header{
 max-width: 500px;
margin: auto 0;
}

delete max-width from .section

this is a example for header, if you want it for contents too you must
put them in a parent div and add the max-width to the contents, and background-color
to the the parent, for centering use margin: 0 auto;


#10

I did it! I included the whole section into a div.
Then give the div a background color, then I set a max-width into section.

Thanks!!!


#11

I will post a link here once I finish the whole cloning project.