2 replies [Last post]
Fokke Nauta
Fokke Nauta's picture
Offline
newbie
Last seen: 7 years 42 weeks ago
Timezone: GMT+2
Joined: 2011-01-04
Posts: 2
Points: 3

Hi all,
On a web page I have a text line. Directly underneath this line I want a text block, indented and italic. An example is here: www.pc3.nl/test/example.doc (from 10.00 to 22.00 MET). I would like to achieve this by CSS. I have tried 2 ways: by using the <ul> tag or the <div> tag. In both cases I use a separate style sheet.
I have used:

<div class="test">text block</div>

In style sheet:

.test {
	float: right;
	margin-left: 20px;
	font-style: italic;
}

or:

<ul>text block</ul>

In style sheet:

ul {
	font-style: italic;
}

It works both ways, but in either case I have a white space between the text line and the indented text block. How can I achieve this without the white space? I want the text line directly followed by the text block.

Thanks in advance for your help.

Rgs,
Fokke Nauta

//mod edit: Source code should be wrapped in bbcode tags, i.e. [code]...[/code]. Fixed. ~gt

Fokke Nauta
Fokke Nauta's picture
Offline
newbie
Last seen: 7 years 42 weeks ago
Timezone: GMT+2
Joined: 2011-01-04
Posts: 2
Points: 3

I have seen that some tags I

I have seen that some tags I put in my post have dissappeared.
This is the text I used. Hope this will work. I left out the tag brackets.

I have tried 2 ways: by using the div tag or the ul tag. In both cases I use a separate style sheet.
I have used:

div class="test" text block /div

In style sheet:
.test {
float: right;
margin-left: 20px;
font-style: italic;
}

or:

ul text block /ul

In style sheet:
ul {
font-style: italic;
}

dirtslayer
dirtslayer's picture
Offline
newbie
canada
Last seen: 7 years 40 weeks ago
canada
Timezone: GMT-6
Joined: 2014-09-19
Posts: 7
Points: 7

using margins

html:

<p> example this is a line of text in its own paragraph</p>
<p class="inny"> some finny text</p>

css:
.inny {
    font-style:italic;
    margin-left:5em;
    margin-top:-1em;
}

http://jsfiddle.net/offk3L5y/