Rectangle 27 11

What I do is take common tasks like centering or floating and make CSS classes out of them. When I do that I can use them throughout any of the pages. I can also call as many as I want on the same element.

.text_center {text-align: center;}
.center {margin: auto 0px;}
.float_left {float: left;}

Now I can use them in my HTML code to perform simple tasks.

<p class="text_center">Some Text</p>

Why is the
tag deprecated in HTML? - Stack Overflow

html tags center deprecated
Rectangle 27 11

What I do is take common tasks like centering or floating and make CSS classes out of them. When I do that I can use them throughout any of the pages. I can also call as many as I want on the same element.

.text_center {text-align: center;}
.center {margin: auto 0px;}
.float_left {float: left;}

Now I can use them in my HTML code to perform simple tasks.

<p class="text_center">Some Text</p>

Why is the
tag deprecated in HTML? - Stack Overflow

html tags center deprecated
Rectangle 27 4

my menu should float left, it is not alone in the menu bar

I believe your mistake is actually your false premise. You don't need to float the elements to keep them inline. If your point is keeping the p and the ul side-by-side, change their display property.

Floating will remove the ability of centering the elements, but display: inline-block for example, lets you horizontally align the elements by their parent, with text-align: center:

#top-bar{
        width: 100%;
        min-height: 35px;
        background-color: #D3D3D3;
        font-family: helvetica, sans-serif;
        text-align: center;
    }

    #top-bar p{
        margin:0;
        padding-top:10px;
        padding-left:10px;
        font-weight: bold;
        display: inline-block;
        vertical-align: middle;
    }

    #top-bar ul{
        margin: 10px auto 0 auto;
        horizontal-align: center;
        border: 1px solid black;
        border-radius: 5px;
        display: inline-block;
        vertical-align: middle;
    }

i am surprised by the number of questions i see that say "i floated my element left, but now i can't center it!".

html - How to horizontally align center
    used as menu which is flo...

html css css3