Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations derfloh on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

padding and percentages

Status
Not open for further replies.

TheConeHead

Programmer
Aug 14, 2002
2,106
US
Is there anyway to do:

padding-left: 75%;

I get some freaky results when I do just that - is there anyway to get the desired results?

[conehead]
 
To have a segment of text now in a div to be over 3/4 (75%) of a page...

[conehead]
 
Don't you just need to set the width of the div then or have I misunderstood?


____________________________________________________________

Need help finding an answer?

Try the Search Facility or read FAQ222-2244 on how to get better results.

 
No I am not wanting a div 75% wide - I want one that is 75% over from the left of the cell it is in... make sense? I do not want a big div but one that is simply over 75% of it's container...

[conehead]
 
A couple of options depending on how you want the div to be positioned.

The first makes a div as wide as it's containing element and applies 75% padding to it, effectively moving your content over.
Code:
<div style="border:1px solid black;padding-left:75%">
<p>Here is my text</p>
</div>

The second moves the whole div to a position 75% across the width of it's containing element.

<div style="border:1px solid black;margin-left:75%">
<p>Here is my text</p>
</div>
[/code]

What are the "freaky results" you mentioned?

Foamcow Heavy Industries - Web design and ranting
Buy Languedoc wines in the UK
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top