Central alignment with offset

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • KeredDrahcir
    Contributor
    • Nov 2009
    • 426

    Central alignment with offset

    I have a nested division. The parent needs to go right across the screen and has a repeating background so that it caters for any resolutions or zoom.

    The child needs to be at a certain point in the page. I found a way to centralise it was to give it a width and set the left and right margin to auto. I want if offset by about 300 pixels to the right. Is there a way to set that?
    Code:
    .my_div{
    	width: 240px;
    	padding: 0;
    	margin: 0 auto 0;
    	position: relative;
    	vertical-align: bottom;
    }
  • shadowstrike
    New Member
    • Aug 2013
    • 21

    #2
    "I have a nested division. The parent needs to go right across the screen and has a repeating background so that it caters for any resolutions or zoom."

    Code:
    .parent-div{
    float:right;
    }
    This is the easiest way of making the parent tag move to the right

    Now for your second part
    "The child needs to be at a certain point in the page"
    Code:
    .child{
      position:absolute;
      margin-left:__ px;
      margin-right:__px;
    }
    Hope I have answered your question.Incase not,provide me with some more details

    Comment

    Working...