Reputation: 11
say I have some text displayed on an html page, which is held in a <div>
tag. The div has width: 100%
. I want the text to be displayed at 3/4ths of the width of the div. So, if the divider is 1000px wide, I want the left padding of the text to be 750px. How can I do this? Thanks!
Upvotes: 1
Views: 430
Reputation: 207
Here you have to first define the container width to 100% and then set padding to whatever % you want.
All calculations will be defined in %.
selector{
width: 100%;
padding-left: 75%;
}
Upvotes: 2