very new to HTML!, How to display two h1 |
very new to HTML!, How to display two h1 |
ILBS |
May 8 2021, 11:47 AM
Post
#1
|
Newbie Group: Members Posts: 14 Joined: 8-May 21 Member No.: 27,930 |
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 |
May 8 2021, 12:06 PM
Post
#2
|
WDG Member Group: Root Admin Posts: 8,365 Joined: 4-August 06 From: Mountain View, CA Member No.: 3 |
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 |
May 8 2021, 12:56 PM
Post
#3
|
Newbie Group: Members Posts: 14 Joined: 8-May 21 Member No.: 27,930 |
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 ! This post has been edited by ILBS: May 8 2021, 12:57 PM |
pandy |
May 8 2021, 02:51 PM
Post
#4
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
You could float them both left.
|
ILBS |
May 8 2021, 02:55 PM
Post
#5
|
Newbie Group: Members Posts: 14 Joined: 8-May 21 Member No.: 27,930 |
How ? What do you mean by I can float them both?
Can you give an example my friend? |
Christian J |
May 8 2021, 03:26 PM
Post
#6
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
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 |
May 8 2021, 05:11 PM
Post
#7
|
Newbie Group: Members Posts: 14 Joined: 8-May 21 Member No.: 27,930 |
Mah what’s the difference between HTML and CSS ????
Confused ! This post has been edited by ILBS: May 8 2021, 05:12 PM |
Christian J |
May 8 2021, 05:34 PM
Post
#8
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
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 |
May 8 2021, 08:08 PM
Post
#9
|
Newbie Group: Members Posts: 14 Joined: 8-May 21 Member No.: 27,930 |
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 |
May 8 2021, 09:55 PM
Post
#10
|
🌟Computer says no🌟 Group: WDG Moderators Posts: 20,730 Joined: 9-August 06 Member No.: 6 |
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 |
May 9 2021, 05:31 AM
Post
#11
|
. Group: WDG Moderators Posts: 9,656 Joined: 10-August 06 Member No.: 7 |
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. |
Lo-Fi Version | Time is now: 25th April 2024 - 10:29 PM |