Jump to content

What HTML do I use to add text between 2 words


Recommended Posts

Hi,

I just need a simple code to add space between words. I have some text above a pic so I would like one word to align to the left and the other to the right. So it would be (if you refer to the image) Seca 674        Information. One of my words is actually a link to another page though so not sure what I can use. I thought of using <p>...</p>  but then the height spacing is too big (like the top image in the picture attached). 

Help!

 

Thanks in advance for all your suggestions.

Spacing.jpg

Link to post
Share on other sites

It doesn't matter which element you use because you can use CSS to change the padding or margin of the element. If it's a link, use <a>. The element you use should describe the content. If any of the elements in the table on this page matches the meaning of your text, then use them. If nothing can properly describe your content then use <div> for block display and <span> for inline display.

You should never choose an HTML element based on how it looks, but based on how well it describes the content. Use CSS to change how an element looks.

Link to post
Share on other sites

This is my text (I use Wordpress for the website): Seca 674 <a href="http://69.89.27.208/~balands8/seca-674/" target="_blank">Information</a>   I want to know what I can use to add a decent space between Seca 674 and Information (which is the link). Nothing of what you said makes much sense to me. Sorry.

Link to post
Share on other sites

The answers are in the CSS tutorial: https://www.w3schools.com/css/css_howto.asp

Quote

There are three ways of inserting a style sheet:

  • External style sheet
  • Internal style sheet
  • Inline style

 

Quote

External Style Sheet


<head>
<link rel="stylesheet" type="text/css" href="mystyle.css">
</head>

 

 

Quote

Internal Style Sheet


<head>
<style>
body {
    background-color: linen;
}

h1 {
    color: maroon;
    margin-left: 40px;
}
</style>
</head>

 

 

Quote

Inline Styles


<h1 style="color:blue;margin-left:30px;">This is a heading</h1>

 

 

Link to post
Share on other sites

This might be over kill, when you can simply add padding to link on left. Wrap in span, span is inline like anchor link

<span>Seca 674<a href="http://69.89.27.208/~balands8/seca-674/" target="_blank">Information</a></span>

then use

span a:before {content: ""; padding-left: 1ex;}

using &nbsp; before anchor text means this will have underline.

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.

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...