Jump to content

What HTML do I use to add text between 2 words


jacestar11
 Share

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 comment
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 comment
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 comment
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 comment
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 comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...