duncanb7
asked on
minus sign html enitity is not working
Dear Experts,
I want my one-line paragraph can be scrolled when it is overflow in div tag.
But the string in the paragraph has minus sign of "-" that will
break the one line into two lines. WHy ?
I want it displayed in one line even minus-sign in the string so I
tried to replace "-" minus sign by - that is html code. But it is not
working, it still breaks it into two lines.
Now it is displayed as follow if "-" is inside
aaaaaaa-
aaaaaaaaaaaaaaaaaaaaaaaaaa aaaaaaaaaa aaaaa
I want
aaaaaaa-aaaaaaaaaaaaaaaaaa aaaaaaaaaa aaaaaaaaaa aaaaaaaaaa
Please advise and read my simple attached php html code
Duncan
I want my one-line paragraph can be scrolled when it is overflow in div tag.
But the string in the paragraph has minus sign of "-" that will
break the one line into two lines. WHy ?
I want it displayed in one line even minus-sign in the string so I
tried to replace "-" minus sign by - that is html code. But it is not
working, it still breaks it into two lines.
Now it is displayed as follow if "-" is inside
aaaaaaa-
aaaaaaaaaaaaaaaaaaaaaaaaaa
I want
aaaaaaa-aaaaaaaaaaaaaaaaaa
Please advise and read my simple attached php html code
Duncan
<html>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<head>
</head>
<body>
<?php
echo "<div style='overflow-x:scroll;overflow-y:scroll;background-color:yellow;width:300px;height:300px;font-size:14px'>";
echo<p>aaaaaaa-aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\n</p>";
echo '</div>';
?>
</body>
</html>
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Chris is right. '-' is one of the few characters that will allow text wrapping because that is the way it has traditionally been used.
ASKER
why - is not working ?
I replaced space with that is working if space is inisde to break the line
I replaced space with that is working if space is inisde to break the line
- is exactly the same as - so it will have exactly the same behaviour.
The works because that's what it's supposed to do (Non Breaking SPace)
The works because that's what it's supposed to do (Non Breaking SPace)
ASKER
Thanks for all of your reply
ASKER
Reminder or memo: nbsp mean non-breaking space not just space for html entity