html - Position a list -
i have list need position on slide. css, have moved list-title <h2>
want it:
.reveal h2 { position: absolute; top: 200px; left: 240px; }
the problem can't move list under <h2>
list-title. here list:
<section id="layout-example" class="slide level1"> <h1>layout example</h1> <h2> list title </h2> <ul> <li>item 1</li> <li>item 2</li> <li>item 3</li> </ul> </section>
i have tried .reveal ul {top: 220px
... etc. list in same (wrong) position.
where should add command in css? have made own css copying 1 of examples included in reveal.js.
when use position: absolute
, element taken out of document flow. <ul>
"becomes top-most element" in flow, regardless of <h2>
is.
to make <ul>
flow after <h2>
, don't use absolute positioning. use:
h2 { padding-top: 200px; padding-left: 240px; } ul { padding-left: 240px; /* assuming want them align left */ }
this ensures <ul>
follows <h2>
.
alternatively, if* must use absolute positioning, make <ul>
absolutely positioned, e.g.:
ul { position: absolute; top: 250px; /* adjust required */ left: 240px; }
Comments
Post a Comment