Jump to content
Stef's Coding Community
bkelly

paragraph won't allow formatting

Recommended Posts

I created this class (I think its a class) in the css file to define a paragraph with a border.

.paragraph_border
  {
  font-family: Verdana, Arial, Helvetica, sans-serif;
  font-weight: bold;
  font-size: 12pt;
  color: green;
  border-top: 2px solid blue;
  border-left:  2px solid blue;
  border-bottom:  2px solid blue;
  border-right:  2px solid blue; 
  }

This I used it with this paragraph in index.htm:



Links to Local Golf Sources  


   "The Golf Doctors" on Merritt Island can repair your clubs and provide the golf 
   accessories you need.  Check them out at 2137 N Courtenay Parkway.  To check
   their web site click 


 

As shown, it works as expected. However, when I uncomment out any of the formatting code it disrupts the paragraph. The border is not placed correctly.

 

What is going on here? Can this be made to work?

Edited by bkelly

Share this post


Link to post
Share on other sites

The

tag defines a paragraph. -

 

By using you hide what's in between from the browser, so it's like it's not even there.

 

That said - there should not be anything between a set of paragraph tags but maybe inline styling. is a header tag - headers belong above paragraphs, not inside them.

is for line breaks - it's not supposed to be uses to create space. the center tag is deprecated and should not be used.

 

So the HTML you have above should really look like this:

Links to Local Golf Sources




"The Golf Doctors" on Merritt Island can repair your clubs and provide the golf
accessories you need. Check them out at 2137 N Courtenay Parkway. To check
their web site click

Share this post


Link to post
Share on other sites

And never use "Click Here"

 

Are you trying to hide something? You don't want the user to know where they are going to go? Blind users should blindly trust you?

 

Click here is unprofessional, user unfriendly and incorrect if you have more than one per page. Just use

TheGolfDoctorisin.com

so they know where they are going.

Share this post


Link to post
Share on other sites

Thelma,

I intended to hide those lines in my post because they were not working. Wickham found that I left quote marks off the end of the link and that fixed one problem.

 

Is there a way to center just one line within a paragraph? I wanted that line "Links to Local Golf Sources" to be centered within the borders of the paragraph. Can that be done?

 

Wickham,

Thanks for noting the missing quote.

 

LSW,

I didn't intend to hide anything as the web site shows when they get there. But I understand your comment and they viewers should should see the address before they go. I'll make my links as you suggest.

Share this post


Link to post
Share on other sites

As Thelma explained, it would be better to put your line "Links to Local Golf Sources" within an tag which you could then style and the rest of your paragraph in

tags.

Share this post


Link to post
Share on other sites

It appears to me that if I define a paragraph style in my CSS, and use that style in a page, then I cannot put a sub paragraph inside the first one. Closing the sub paragraph appears to close out the CSS declaration/definition. Is there a legitimate method of embedding paragraphs within paragraphs in CSS?

Share this post


Link to post
Share on other sites

No. A paragraph can not contain another paragraph. The closing tags get confused. And it is poor semantics. A Paragraph can contain a span, though.

Share this post


Link to post
Share on other sites
Is there a way to center just one line within a paragraph?

 

Various ways.

You have to start a new paragraph or heading with text-align: center; either inline

Centered text

or as a class

.centertext { text-align: center; }

Centered text

 

or you can use a span tag inside one p tag which needs display: block to start a new line 100% wide. This keeps the same line height and margins between lines (a new p tag will probably create more space between lines):-

css:-

.centertextspan { display: block; text-align: center; }

html markup:-

hello hello hello hello hello hello hello hello hello hello hello hello hello hello hello

hello hello hello hello hello hello hello hello hello hello hello hello hello

hello hello hello hello hello hello

hello hello hello hello hello hello hello hello hello hello hello hello

hello hello hello hello hello hello hello hello hello hello hello

Edited by Wickham

Share this post


Link to post
Share on other sites

But for the part we're discussing here (see Post #1), the logical, semantic solution is to put the TITLE (Links to....) inside tags - which one (h1, h2, h3, h4, h5, etc) depends on the remaining content.

Share this post


Link to post
Share on other sites

Thelma, Wickham, jlhaslip, Virtual, and LSW,

I think I understand the last three posts. Thanks.

 

You have helped me resolve the initial problem and led me to much new information. I think I'll let this stop here and continue working on improving my site and expanding my knowledge of what you have shown me. Thank you for all the time you spent answering my questions.

:) :) :) :)

Bryan

Edited by bkelly

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...

×
×
  • Create New...