How to get 2 styles of text on same...

User 2279538 Photo


Registered User
1 post

I am trying to get 2 styles of text into a container where size defined large enough for text. It always ><h1 class="it">text always shows up on another line.
CSS:
#wrapper2 { height:180px; float: left; width: 78%; margin: 10px; border: 5px solid #000000;background-color: orange;padding:10px}

h1 { color: #0000FF; margin: 0 0 3px; 0;font-size:60px;float:top left;}

.it {font-style: italic;}

.smaller {font-size:30px;font-style:italic;}

HTML:
<div id="wrapper2">
<h1>B Eli Fishpaw</h1><h1 class="it">Architect</h1>
<h1 class="smaller">Conservation Design Consultant</h1>
</div>

Your help will be appreciated.
Eli
User 122279 Photo


Senior Advisor
14,649 posts

Change this line

<h1>B Eli Fishpaw</h1><h1 class="it">Architect</h1>


to this:

<h1>B Eli Fishpaw <span class="it">Architect</span></h1>


Also, it is not good to have more than one instance of <h1> on the same page, so I would write the css like this:

#wrapper2 { height:180px; float: left; width: 78%; margin: 10px; border: 5px solid #000000;background-color: orange;padding:10px}

h1 { color: #0000FF; margin: 0 0 3px; font-size:60px; float:top left;}

.it {font-style: italic;}

h2 {color: #0000FF; font-size:30px;font-style:italic; margin-top: 0; }</style>


and the html like this:

<div id="wrapper2">
<h1>B Eli Fishpaw <span class="it">Architect</span></h1>
<h2>Conservation Design Consultant</h2>
</div>


The margin-top: 0; has been put in to reduce the gap between the h1 and h2 headings, which otherwise would have been a great deal larger.
Ha en riktig god dag!
Inger, Norway

My work in progress:
Components for Site Designer and the HTML Editor: https://mock-up.coffeecup.com



Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.