Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ very new to HTML!

Posted by: ILBS May 8 2021, 11:47 AM

Hi

I would like to display h1 as "Hello world"

and I want to display this character ">" to the right of "Hello world"

I tried this:

CODE

<h1> HOME </h1>
<h1> > </h1>



But I get:

Hello World

>


=========
But I want

Hello world >


All help appreciated

thanks

Posted by: Darin McGrew May 8 2021, 12:06 PM

H1 is a block element. By default, block elements appear below previous block elements.

Why not put everything in the same H1 element?

HTML
<h1> HOME > </h1>

Posted by: ILBS May 8 2021, 12:56 PM

Hi Darin

Yes I could do that .... but for curiosity’s sakes how would we do that ..... for example what if my tags were different and I have a h1 and h2 and I want them one next to each other?

I just started today so I don’t know anything !!!!

Thanks for replying !

Posted by: pandy May 8 2021, 02:51 PM

You could float them both left.

Posted by: ILBS May 8 2021, 02:55 PM

How ? What do you mean by I can float them both?
Can you give an example
my friend?

Posted by: Christian J May 8 2021, 03:26 PM

QUOTE(ILBS @ May 8 2021, 07:56 PM) *

for example what if my tags were different and I have a h1 and h2 and I want them one next to each other?

It wouldn't make sense to use a H2 element just for a ">" character, but besides that you could style them with say CSS "float: left" or "display: inline" to make the H1 and H2 appear on the same line.

For an (old) introduction to CSS, see https://htmlhelp.com/reference/css/

Posted by: ILBS May 8 2021, 05:11 PM

Mah what’s the difference between HTML and CSS ????
Confused !

Posted by: Christian J May 8 2021, 05:34 PM

HTML is for creating basic functionality (links, forms, embedding images, etc) and to assign semantic meaning to content (such as indicating that some text is meant to be a heading).

CSS is just for styling or decorating the HTML. For example, CSS can make a link look like ordinary text, but it would still be a link (just harder to find by the user).

Posted by: ILBS May 8 2021, 08:08 PM

Ok thanks

So what is the code in Hrml if I want to display two pieces of
Text one next to each other like this

HOME >

And can’t be the same h1 tag because HOME can change and the > can change! So I want them separate !

Thanks

Posted by: pandy May 8 2021, 09:55 PM

What has that something might change to do with that you need them to be separate elements? Are you really going the have the word HOME and a > or are they placeholders for something else?

Posted by: Christian J May 9 2021, 05:31 AM

QUOTE(ILBS @ May 9 2021, 03:08 AM) *

And can’t be the same h1 tag because HOME can change and the > can change! So I want them separate !

If you mean change styling, you could use other HTML elements inside the H1. For example:

CODE
<h1>Foo<span>Bar</span></h1>

and then style the SPAN element differently with CSS.



Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)