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 5126 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 and the part below
should push back up again.
How?
|
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 onbeforeunload="releaseLock();>
| |
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 little differently. Do they simply just
read a document top-to-bottom and left-to-right and just display
elements in the order in which they encounter...
|
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
http://www.math.ufl.edu/~squash/course.calc3.html
|
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+$", "g");
Then the output is the same.
|
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 have tried:
var text = document.getElementById("test").value, also tried document.getElementById("test").firstChild
but none of them return...
|
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it. ...
| |
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules.
He will explain when you may want to use classes...
|
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 we have to send another system
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating...
| |