Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 10-28-2009, 11:55 PM   PM User | #1
cmt
New to the CF scene

 
Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
cmt is an unknown quantity at this point
Highlighted text problem

Hi,

First, please note that I'm a really unexperienced beginner at web development! Programming at Objective-C is my area and now I'm trying some HTML CSS.

I have here a problem probably very easy to solve but I have no idea:

Why does the highlighted text goes over the limits of the div tag at a 1 column design? A made here a example where this happens:

Code:
<head>
<title>Highlight test</title>
<style type="text/css">
<!--
body {margin:0;}
#content {
	width:600px;
	height:2000px;
	background-color:#CCC;
	margin:0 auto;
	padding:10px;
}
-->
</style>
</head>

<body>
	<div id="content">
    	<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Maecenas nunc odio, tempus id imperdiet porta, adipiscing at odio. Proin dolor nulla, molestie eleifend ultricies sed, placerat quis massa. Duis risus velit, accumsan vel iaculis id, fringilla non ligula. Pellentesque malesuada lorem sit amet sapien suscipit molestie. Duis quis magna sit amet est mollis adipiscing ac eget purus. Nunc elementum ipsum in arcu pellentesque dictum. Suspendisse ligula lectus, scelerisque id auctor vitae, venenatis et nisi. Suspendisse risus nisl, tincidunt a pellentesque eu, tempus vitae risus. Sed vehicula augue venenatis odio bibendum tempor. Fusce lacus nisl, tristique eget lacinia vitae, molestie et lorem. Proin eu imperdiet mauris. Quisque id neque tortor, ac ultrices leo. Ut metus augue, molestie sit amet rhoncus sit amet, dapibus sit amet ante. Proin eu leo urna. Proin quis ipsum at orci venenatis tempus sed non arcu. Suspendisse potenti. Proin sed mauris neque, ac molestie velit. Etiam risus nunc, suscipit eget eleifend a, scelerisque et libero. Mauris ut lorem nisi, quis eleifend justo. Mauris mollis vestibulum blandit.</p>
    </div>
</body>
</html>
When you select that text, the highlight goes outside the div also.

I'd love to know why this happens and how to fix it.

Thank you so much
Attached Thumbnails
Click image for larger version

Name:	hl_over.jpg
Views:	29
Size:	48.7 KB
ID:	7880  
cmt is offline   Reply With Quote
Old 10-29-2009, 12:01 AM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello cmt,
I just copy/pasted your code and I'm not seeing the same results your screencap shows. Are you testing in IE6?
It selecting only the text here with FF3.5 and IE8.

Check out the link in my sig about DocTypes. Might make all the difference.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Old 10-29-2009, 12:13 AM   PM User | #3
cmt
New to the CF scene

 
Join Date: Oct 2009
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
cmt is an unknown quantity at this point
Hi Excavator,

Actually I'm using Safari 4 on MacOS 10.6.1 .

Thanks by your article, I'll read carefully although I know it's importance. I propositaly removed this for making the code smaller.

This is pretty annoying and happens also on Dreamweaver LiveView, as you can see at this other screenshot: http://dl.getdropbox.com/u/2274153/img2.png

Thank you
cmt is offline   Reply With Quote
Old 10-29-2009, 12:38 AM   PM User | #4
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
You can't trust DW's live view. Who knows what browser that is emulating...

Test your code in a standards compliant browser like FireFox. Much more dependable.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 10:44 AM.


Advertisement
Log in to turn off these ads.