I have a <p> tag inside a div. I need to set a fixed size/width for this <p>, but each time I increase that fix value the <p> don't response to that fix value and keep writing on the div.
1. You need to check that the class or id you are using is the same of the <p> or if it is the class of div being used?
2. You need to check that the <p> is being nested inside the <div> Is it floating outside? If so than check that are you using float property?
3. You are saying that there is no effect on the width of <p> There will never be an effect on <p> You see that <p> Is inside the <div> so that means that the <p> No matter how wide will always stay inside the <div> I mean
div {
width: 50px
height: 40px;
}
// The p will automatically have a width of 50px and height of 40px. You cannot make the p exceed this limit.
// Secondly you can set the value for p lesser than div like
p {
width: 40px;
height: 30px;
}
// The below code will be useless..
p {
width: 60px;
height: 40px;
}
So that can be an issue. Try to have a look at it.
If problem persists please increase the width and height of div.
Please "Marks As Answer" if any answer helped you out!
~~! FIREWALL !~~
Rana Andraws
Member
30 Points
70 Posts
Set a limit size for a <p>
Jan 20, 2013 11:24 AM|LINK
Hi all,
I have a <p> tag inside a div. I need to set a fixed size/width for this <p>, but each time I increase that fix value the <p> don't response to that fix value and keep writing on the div.
ramramesh
Member
458 Points
158 Posts
Re: Set a limit size for a <p>
Jan 20, 2013 11:32 AM|LINK
<p style="width:10px;height:6px"></p>
velambath
Member
396 Points
111 Posts
Re: Set a limit size for a <p>
Jan 20, 2013 12:47 PM|LINK
HI Rana.
Pls show, how you placed your div and p tag. And how you need it to be...
- Rigin
Afzaal.Ahmad...
Contributor
2660 Points
1039 Posts
Re: Set a limit size for a <p>
Jan 20, 2013 02:24 PM|LINK
1. You need to check that the class or id you are using is the same of the <p> or if it is the class of div being used?
2. You need to check that the <p> is being nested inside the <div> Is it floating outside? If so than check that are you using float property?
3. You are saying that there is no effect on the width of <p> There will never be an effect on <p> You see that <p> Is inside the <div> so that means that the <p> No matter how wide will always stay inside the <div> I mean
div { width: 50px height: 40px; } // The p will automatically have a width of 50px and height of 40px. You cannot make the p exceed this limit. // Secondly you can set the value for p lesser than div like p { width: 40px; height: 30px; } // The below code will be useless.. p { width: 60px; height: 40px; }So that can be an issue. Try to have a look at it.
If problem persists please increase the width and height of div.
~~! FIREWALL !~~