Lijn naar onder na float left?

Overzicht Reageren

Sponsored by: Vacatures door Monsterboard

Senior, Medior and Junior SAP HANA Developer

Vacature details Vakgebied: Software/IT Opleiding: Medior Werklocatie: Veldhoven Vacature ID: 12696 Introductie Our client is the world's leading provider of lithography systems for the semiconductor industry, manufacturing complex machines that are critical to the production of integrated circuits or chips. Our purpose is “unlocking the potential of people and society by pushing technology to new limits”. We do this guided by the principles “Challenge”, “Collaborate” and “Care”. Wat verwachten we van jou? SAP Certified Application Associate - SAP HANA Cloud Modeling (training and/or certification) Bachelor degree or higher Excellent understanding of SAP HANA (2.0 / Cloud), Data Modelling and writing

Bekijk vacature »

Bob Devlees

bob Devlees

13/07/2011 19:07:58
Quote Anchor link
Beste,

Wanneer ik volgende code gebruik:
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
<div class=\"titlemidblspace\">Titel</div>
<div class=\"lucidaspace\">Tekst hieronder</div>


en
Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
.titlemidblspace
{
    FONT-SIZE: 18px; COLOR: #3a3a3a; FONT-FAMILY: Arial; FLOAT: LEFT; PADDING-TOP: 30px; PADDING-BOTTOM: 16px;
}
.lucidaspace
{
    LINE-HEIGHT: 20px; FLOAT: LEFT;
}


Krijg ik in Mozilla en Chrome hetgeen wat ik wil, dus :

Titel
Tekst hieronder

Maar wanneer ik Internet explorer gebruik, krijg ik het volgende:

TitelTekst hieronder

Hij zet dus de tekst er gewoon achter, weet iemand hoe ik dit kan oplossen?
 
PHP hulp

PHP hulp

28/04/2024 02:19:49
 
Ozzie PHP

Ozzie PHP

13/07/2011 20:16:22
Quote Anchor link
Float: left; betekent dat ie de divjes achter elkaar zet, dus het is logisch dat ze achter elkaar staan.

Verder: schrijf je css niet met hoofdletters maar met kleine letters en onder elkaar. Gebruik de verkorte schrijfwijze voor je padding:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
.titlemidblspace {
   font-size:18px;
   color:#3a3a3a;
   font-family:Arial;
   padding:30px 0 16px;
}

.lucidaspace {
   line-height: 20px;
}


In plaats van een aparte class voor je titel en je tekst te gebruiken is het beter om symantische opmaak te gebruiken met een header element als titel en het paragraph element voor je tekst.

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
<h1>Titel</h1>
<p>
   Hier komt je tekst.
</p>


Je css moet je dan ook aanpassen:

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
4
5
6
7
8
9
10
h1 {
   font-size:18px;
   color:#3a3a3a;
   font-family:Arial;
   padding:30px 0 16px;
}

p {
   line-height: 20px;
}
 
The Force

The Force

13/07/2011 20:34:06
Quote Anchor link
Heb je al geprobeerd "display: inline;" en/of "position: relative;" toe te voegen? IE gaat raar om met floats.
 
Ozzie PHP

Ozzie PHP

13/07/2011 20:37:22
Quote Anchor link
The Force op 13/07/2011 20:34:06:
Heb je al geprobeerd "display: inline;" en/of "position: relative;" toe te voegen? IE gaat raar om met floats.

Die floats moeten daar helemaal niet staan. Hij wil dat de titel en de tekst onder elkaar komen te staan.
Gewijzigd op 13/07/2011 20:37:52 door Ozzie PHP
 
Bob Devlees

bob Devlees

13/07/2011 20:38:59
Quote Anchor link
Oke, thanks! Ik ga ermee aan de slag!

Toevoeging op 13/07/2011 20:57:22:

Mm, wat als ik binnen die H1 code bijvoorbeeld 1 woord in een ander kleur wil zetten? Moet ik dan een aparte div voor dit woord zetten of hoe pak ik dit het best aan?
 
Ozzie PHP

Ozzie PHP

13/07/2011 21:15:04
Quote Anchor link
<h1>Titel met <span>rood</span> woord</h1>

Code (php)
PHP script in nieuw venster Selecteer het PHP script
1
2
3
h1 span {
   color:red;
}
 
Wouter J

Wouter J

13/07/2011 23:10:36
Quote Anchor link
Een div heeft standaard display: block; en is dus voor dit soort dingen niet geschikt. Een span heeft standaard display: inline; en is hier dus zeer geschikt voor. Zie daarvoor ook dit voorbeeldje: http://waldio.webatu.com/html/standaard_waarden.htm
 
Bob Devlees

bob Devlees

14/07/2011 10:18:35
Quote Anchor link
Werkt perfect!
 



Overzicht Reageren

 
 

Om de gebruiksvriendelijkheid van onze website en diensten te optimaliseren maken wij gebruik van cookies. Deze cookies gebruiken wij voor functionaliteiten, analytische gegevens en marketing doeleinden. U vindt meer informatie in onze privacy statement.