CSS regte Eiendom
Voorbeeld
Stel die regterrand van die geposisioneerde <div>-element 150px aan die linkerkant van die regterrand van sy naaste geposisioneerde voorouer:
div.absolute {
position: absolute;
right:
150px;
width: 200px;
height: 120px;
border: 3px solid
green;
}
Meer "Probeer dit self" voorbeelde hieronder.
Definisie en gebruik
Die right
eienskap beïnvloed die horisontale posisie van 'n geposisioneerde element. Hierdie eienskap het geen effek op nie-geposisioneerde elemente nie.
- Indien posisie: absoluut; of posisie: vas; - die
right
eienskap stel die regterrand van 'n element na 'n eenheid regs van die regterrand van sy naaste geposisioneerde voorouer. - Indien posisie: relatief; - die
right
eienskap stel die regterrand van 'n element na 'n eenheid links/regs van sy normale posisie. - Indien posisie: taai; - die
right
eiendom tree op asof sy posisie relatief is wanneer die element binne die uitsigpoort is, en asof sy posisie vas is wanneer dit buite is. - Indien posisie: staties; - die
right
eiendom het geen effek nie.
Standaard waarde: | outo |
---|---|
Geërf: | geen |
Animateerbaar: | ja. Lees oor animeerbaar |
Weergawe: | CSS2 |
JavaScript-sintaksis: | voorwerp .style.right="200px" |
Blaaierondersteuning
Die nommers in die tabel spesifiseer die eerste blaaierweergawe wat die eiendom ten volle ondersteun.
Property | |||||
---|---|---|---|---|---|
right | 1.0 | 5.5 | 1.0 | 1.0 | 5.0 |
CSS-sintaksis
right: auto|length|initial|inherit;
Eiendomswaardes
Value | Description | Play it |
---|---|---|
auto | Lets the browser calculate the right edge position. This is default | |
length | Sets the right edge position in px, cm, etc. Negative values are allowed. Read about length units | |
% | Sets the right edge position in % of containing element. Negative values are allowed | |
initial | Sets this property to its default value. Read about initial | |
inherit | Inherits this property from its parent element. Read about inherit |
Meer voorbeelde
Voorbeeld
Gebruik die regte eienskap met 'n negatiewe waarde en vir 'n element met geen geposisioneerde voorouers nie:
div.b {
position: absolute;
right: -20px;
width: 100px;
height: 120px;
border: 3px solid blue;
}
div.c {
position: absolute;
right: 150px;
width: 200px;
height: 120px;
border: 3px solid green;
}
Verwante bladsye
CSS-tutoriaal: CSS-posisionering
CSS verwysing: linker eiendom
CSS verwysing: onderste eiendom
CSS verwysing: top eiendom
HTML DOM verwysing: regte eiendom