how to add a margin on both sides and center the text in a paragraph?


Tags: css,margin,wrap,paragraph,paragraphs

Problem :

http://img.cmsszablony.pl/images/2014/02/12/paragraphs_helps.png - image to help

how to add margin left and right on both sides and middle text in line with text on right side? please answers to my question, sory for my english ;/

This is my code HTML:

<div class="row1 gensmall wrap">        
<p class="alignleft">{TOTAL_USERS_ONLINE}<br />{TOTAL_USERS}{TOTAL_FEMALE}{TOTAL_MALE}{COUNTER}</p> 
<p class="alignright">{POSTED_TODAY}<br />{USERS_OF_THE_DAY_LIST} {USERS_OF_THE_DAY_COUNT}</p>
</div>

And CSS:

.wrap {
display: table;
width:100%;
}
.alignleft {
    float: left;
}
.alignright {
    float: right;
    text-align:right;
}

Please to help me, thanks.



Solution :

I'm not sure if this is what you want.

Sample

just add this in your CSS

p{
    margin:10px;
}

Note: Just resize the window if the text breaks.


    CSS Howto..

    How to show scrollbar when the inner content is aligned to bottom?

    How to pre-complie css style sheets in rails 2.3?

    How to make SVG clip-path work correctly in Google Chrome?

    How can i execute two effects on .mousenter THIS?

    How to know from css if a select is opened

    How can I have an image float next to a centered div?

    How to make a photo collage using html and css? [closed]

    CSS: How to center texts with transitioning position?

    How to toggle a div to slide up and down

    How to add spacing in between
    [duplicate]

    How to convert HTML button to HTML input, while keeping all CSS?

    How to write a CSS selector that works on nested divs and selects the closest match?

    How to change scrollbar position from bottom to top of the element?

    jquery how to make an element comeback to initial position after animation

    How to adjust the opacity of CSS background image instead of radio button with an icon overlay

    JavaFX - Where is the css file for definition of StageStyle located or how can I change it?

    How can I use CSS to set as my
  • background if I'm using the Zend framework?
  • How to make a jquery slider from scratch

    how to put a css class inside of a css class?

    How to hide main menu while showing sub-menu in css

    Single
    with Box-Shadow = 6 cicles. How it works?

    how to find a css class which has another css class as sibling

    how do I modify a :hover style using JavaScript / jQuery?

    How can I vertically center this css/javascript based modal dialog?

    How to make an arrow in html5 or css

    How can i overlap inline divs?

    How to collapse div same like facebook chat

    How to show list items in menu when hover on the parent's it via CSS? [closed]

    Background image cut off outside of item. How can I make it show?

    How to correctly display HTML page in browser and mobile