The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> very new to HTML!, How to display two h1
ILBS
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Darin McGrew
post 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>
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
ILBS
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post May 8 2021, 02:51 PM
Post #4


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
Joined: 9-August 06
Member No.: 6



You could float them both left.
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
ILBS
post 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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post May 8 2021, 03:26 PM
Post #6


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



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/
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
ILBS
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post May 8 2021, 05:34 PM
Post #8


.
********

Group: WDG Moderators
Posts: 9,630
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).
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
ILBS
post 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
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post May 8 2021, 09:55 PM
Post #10


🌟Computer says no🌟
********

Group: WDG Moderators
Posts: 20,716
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?
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post May 9 2021, 05:31 AM
Post #11


.
********

Group: WDG Moderators
Posts: 9,630
Joined: 10-August 06
Member No.: 7



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.


User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Reply to this topicStart new topic
2 User(s) are reading this topic (2 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 28th March 2024 - 04:04 PM