Help - Search - Members - Calendar
Full Version: very new to HTML!
HTMLHelp Forums > Web Authoring > Markup (HTML, XHTML, XML)
ILBS
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
Darin McGrew
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>
ILBS
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 !
pandy
You could float them both left.
ILBS
How ? What do you mean by I can float them both?
Can you give an example
my friend?
Christian J
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/
ILBS
Mah what’s the difference between HTML and CSS ????
Confused !
Christian J
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).
ILBS
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
pandy
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?
Christian J
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.


This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2024 Invision Power Services, Inc.