Markus 6,050
Recognized Expert Expert
I'm a new designer and pretty young - 16.
I've recently encountered a problem with the paragraph tag inside a div.
I have a div within a div (both with id selectors) when i place a paragraph tag within the second div the line moves into a different posistion. Without the p tag the text is displayed properly.
Please help, it would be much appreciated. -
<body bgcolor="#999999">
-
<div id="content">
-
<div id="content-top-bar"><p>This text appears a line down as to where you would expect it to be.<p/></div>
-
</div>
-
</body>
-
body{
-
background-color: #999999;
-
margin: 0;
-
padding: 0;
-
}
-
-
#content{
-
background-color: #ffffff;
-
margin: 0 15% 0 15%;
-
height: 600px;
-
padding: 4px;
-
}
-
-
#content-top-bar{
-
background-color: #ffffff;
-
height: 40px;
-
border-width: 2px 2px 6px 2px;
-
border-style: solid;
-
border-color: #999999;
-
}
-
-
8 5118 Markus 6,050
Recognized Expert Expert
It happens with any tag i use inside the div. :( This is so annoying. I've searched for hours and it's such a small script. I feel like such a damn failure, i've got no chance if i can't even suss this out. >=[ here's the example
You need to be more specific. What line? Which tags? Also, you declare Xhtml but some of your markup does not exist in Xhtml and is incorrect in html.
nathj 938
Recognized Expert Contributor
I'm a new designer and pretty young - 16.
I've recently encountered a problem with the paragraph tag inside a div.
I have a div within a div (both with id selectors) when i place a paragraph tag within the second div the line moves into a different posistion. Without the p tag the text is displayed properly.
Please help, it would be much appreciated. -
<body bgcolor="#999999">
-
<div id="content">
-
<div id="content-top-bar"><p>This text appears a line down as to where you would expect it to be.<p/></div>
-
</div>
-
</body>
-
body{
-
background-color: #999999;
-
margin: 0;
-
padding: 0;
-
}
-
-
#content{
-
background-color: #ffffff;
-
margin: 0 15% 0 15%;
-
height: 600px;
-
padding: 4px;
-
}
-
-
#content-top-bar{
-
background-color: #ffffff;
-
height: 40px;
-
border-width: 2px 2px 6px 2px;
-
border-style: solid;
-
border-color: #999999;
-
}
-
-
One possible option is to set up a specific p class in the css that sets the padding and margins exactly as you want them.
Also try setting the position of the nested div to relative. I've had similar issues myself recently and this sorted me out. Unfortunately my development is currently all local so I can't show you that.
Finally, playing around with this stuff is often the name of the game, you are not a failure - be more positive.
Cheers
Nathan
Markus 6,050
Recognized Expert Expert
One possible option is to set up a specific p class in the css that sets the padding and margins exactly as you want them.
Also try setting the position of the nested div to relative. I've had similar issues myself recently and this sorted me out. Unfortunately my development is currently all local so I can't show you that.
Finally, playing around with this stuff is often the name of the game, you are not a failure - be more positive.
Cheers
Nathan
I tried the posistion: relative but nothing changed. I also changed the declaration to html - nothing happened. It looks as though there's something pushing the text down from the top andalso it isn't even being contained inside the div. It's just floats past it exceeding the div. - This was because of the height: 30px;
I've tried and tried all i can think of - which, in all honesty, isn't much.
- it's giving a blank line-break before and after the actual tag. This happens with most tags and all the line breaks are relative to the size of the text.
Could this be something to do with block elements?
Where can i find the CSS HTML God?
<3
Markus 6,050
Recognized Expert Expert
You need to be more specific. What line? Which tags? Also, you declare Xhtml but some of your markup does not exist in Xhtml and is incorrect in html.
Line 3, sorry. I changed the declaration to no avail. I'll just keep trying with it, somethings got to give, right?
<3
Markus 6,050
Recognized Expert Expert
Ok, it appears it's only in Opera. Sorry.
Opera is no-longer my favourite browser.
<3
nathj 938
Recognized Expert Contributor
I'm a new designer and pretty young - 16.
I've recently encountered a problem with the paragraph tag inside a div.
I have a div within a div (both with id selectors) when i place a paragraph tag within the second div the line moves into a different posistion. Without the p tag the text is displayed properly.
Please help, it would be much appreciated. -
<body bgcolor="#999999">
-
<div id="content">
-
<div id="content-top-bar"><p>This text appears a line down as to where you would expect it to be.<p/></div>
-
</div>
-
</body>
-
body{
-
background-color: #999999;
-
margin: 0;
-
padding: 0;
-
}
-
-
#content{
-
background-color: #ffffff;
-
margin: 0 15% 0 15%;
-
height: 600px;
-
padding: 4px;
-
}
-
-
#content-top-bar{
-
background-color: #ffffff;
-
height: 40px;
-
border-width: 2px 2px 6px 2px;
-
border-style: solid;
-
border-color: #999999;
-
}
-
-
Just spotted something- line 3 the closing paragraph tag is written as <p/>, this should be </p>.
Does that make any difference?
nathj
Markus 6,050
Recognized Expert Expert
Just spotted something- line 3 the closing paragraph tag is written as <p/>, this should be </p>.
Does that make any difference?
nathj
Nope. I really can't suss what the problem is. I've given up now but thanks anyway :)
xx
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: NotGiven |
last post by:
I have a form that inserts records in a database. When I display records,
the paragraphs don't show up.
I am using dreamweaver MX, PHP, and MySQL.
|
by: bluekite2000 |
last post by:
I want Matrix A(B) to create shallow copy of B but A=B to create deep
copy of B. Is that bad design? Why and why not?
|
by: AFN |
last post by:
I want to click a checkbox and have a 4 line (approx) paragraph appear
beneath the checkbox, pushing the rest of the page down. And when
unchecking the checkbox, the paragraph should disappear...
|
by: lawrence |
last post by:
I have a list of lists, and each lists has a heading. I want the
heading to be grouped with its list. Can I do this:
<p>
<h5>My title</h5>
<ul>
<li>books</li>
<li>dogs</li>
</ul>
</p>
|
by: RJN |
last post by:
Hi
I have an onbeforeunload event where in I call a server side script to
release some locks on the databse.
function releaseLock()
{
__doPostBack('btnUnlock','');
}
<body...
| |
by: Viken Karaguesian |
last post by:
Hello everyone,
Me again. Trying to learn some more :>) I hope I got the terminology
right.
How does a browser parse (correct term?) an HTML document. I'm sure
that every browser does it a...
|
by: gentsquash |
last post by:
I'm trying to display a paragraph that has a centered
phrase,
such as this one,
in the middle of the paragraph. An example is the section
"End of semester project" on my course-page
...
|
by: Cain |
last post by:
A very simple regular expression test:
var regx = /^\d+$/g;
alert(regx.test("11") + ": " + regx.test("11"));
And the output is "true: false".
If I change to regx = new RegExp("^\\d+$",...
|
by: rahullko05 |
last post by:
i need to access the value of paragraph tag using dom in javascript.
lets say there is <p id="test">this is test para </p>
now how to access the value inside this para ie. "this is test para"?
i...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...
| |