Solved

Style sheets: Inline boxes

Posted on 1998-09-05
5
274 Views
Last Modified: 2010-04-09
I will increase points to 85 if you have a working answer:

Understanding of course, that netscape and IE have limited and varying implementations of CSS, I have the following question: I want to make a line of text which contains an inline box with a border followed by regular text. Here is my CSS code:

P {
font-size: 12pt;
line-height: 14pt;
text-align: left;
vertical-align: top;
font-family: geneva,verdana,tahoma,arial,helvetica;}

EM { color: red;
border-style: groove;
border-width: thick;
border-color: red; }

And here is my HTML code:

<P>Here is some text <em>contained within </em> a block of text</P>

What I get in netscape is three lines of text, the middle one (<em>) has the border of course. Now, how do I get these on one line and not three?
0
Comment
Question by:65471
5 Comments
 
LVL 10

Expert Comment

by:MasseyM
ID: 1837372
I don't even get the border in mine..  All I get is the red tet.. (all on one line) -- IE 4.01

0
 
LVL 6

Accepted Solution

by:
ckayter earned 30 total points
ID: 1837373
Rather than using <em> tags, try defining the border in a span class.

In your CSS file:

SPAN.em { color: red; border-style: groove; border-width: thick;
border-color: red }

In your text:

<P>Here is some text <SPAN CLASS="em">contained within </SPAN> a block of text</P>

I'm not sure HTML will permit you to put a border around a group of characters within a line, but if you can, this is how it would be done.

Colleen

0
 
LVL 8

Expert Comment

by:jbirk
ID: 1837374
I looked into Colleen's suggestions and they don't work in Netscape...  I'm not sure if there is a control for this that will work in Netscape 4.0-4.05 (maybe 4.06 fixed it?) but I suppose a workaround could be to use tables forcing them to occur on the same line...  something like this:
<html>
<head>
<style type="text/css">
SPAN.em { color: red; border-style: groove; border-width: thick;
    border-color: red }
</style>
</head>
<body>
    In your text:

<TABLE cellpadding=0 cellspacing=0 border=0><TR>
<TD vali>Here is some text </TD>
<TD><SPAN CLASS="em">contained within</SPAN> </TD>
<TD>&nbsp;a block of text</TD></TR></TABLE>
</body>
</html>

-Josh
0
 

Author Comment

by:65471
ID: 1837375
Thanks kcarter, but I tried that previously. It's not that you were wrong per se, the CSS 2.0 spec allows that. It's just that Netscape and IE aren't yet fully border savvy. I think jbirk's answer is the best way for now. Although, I had hoped to avoid that. But, I'll give kcarter some points and if jbirk wants any, he can email me to resubmit the question.
0
 
LVL 8

Expert Comment

by:jbirk
ID: 1837376
That's ok, just happy to help... err...  well sort of.

Best of luck!
-Josh
0

Featured Post

ScreenConnect 6.0 Free Trial

Discover new time-saving features in one game-changing release, ScreenConnect 6.0, based on partner feedback. New features include a redesigned UI, app configurations and chat acknowledgement to improve customer engagement!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Tags from access to excel 3 38
Bootstrap on PLNKR 3 29
Help to align the buttons in a row 2 27
Applications / Web Apps that enable highlighting text on Web Pages 3 25
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
Use these top 10 tips to master the art of email signature design. Create an email signature design that will easily wow recipients, promote your brand and highlight your professionalism.
In this tutorial viewers will learn how to position items using CSS's three positioning types Create a new HTML document with an internal stylesheet.: Create another div in CSS and name it Absolute : Type "position:absolute;" and "top:10px; left:50p…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question