Διάταξη CSS - Πορό
- Επόμενη Σελίδα CSS z-index
- Προηγούμενη Σελίδα CSS Πλεκτά
CSS overflow property controls how content that is too large to fit in the area is handled.
CSS Overflow
overflow
The property specifies whether the content is clipped or a scrollbar is added when the content is too large to fit in the specified area.
overflow
The property can be set to the following values:
visible
- Default. Overflow is not clipped. Content is rendered outside the element boxhidden
- The overflow is clipped, and the rest of the content will be invisiblescroll
- The overflow is clipped, and a scrollbar is added to view the rest of the contentauto
- Withscroll
Similarly, but only adds a scrollbar when necessary
Note:overflow
The property only applies to block elements with a specified height.
Note:In OS X Lion (on Mac), the scrollbar is hidden by default and only appears when used (even if "overflow:scroll" is set).
overflow: visible
By default, overflow is visible (visible
), this means it will not be clipped but rendered outside the element box:
Παράδειγμα
div { width: 200px; height: 50px; background-color: #eee; overflow: visible; }
overflow: hidden
If you use hidden
The value, the overflow will be clipped, and the rest of the content will be hidden:
Παράδειγμα
div { overflow: hidden; }
overflow: scroll
If the value is set to scroll
The overflow will be clipped, and a scrollbar will be added to scroll within the box. Note that this will add a scrollbar in both horizontal and vertical directions (even if you do not need it):
Παράδειγμα
div { overflow: scroll; }
overflow: auto
auto
The value is similar to scroll
However, it only adds a scrollbar when necessary:
Παράδειγμα
div { overflow: auto; }
overflow-x and overflow-y
overflow-x
and overflow-y
The property determines whether the content overflow is changed horizontally or vertically (or both):
overflow-x
Specify how to handle the left/right edges of the content.overflow-y
Specify how to handle the top/bottom edges of the content.
Παράδειγμα
div { overflow-x: hidden; /* Κατάργηση πλαισίου συρράβματος horizontal */ overflow-y: scroll; /* Προσθήκη πλαισίου συρράβματος vertical */ }
Όλες οι ιδιότητες CSS Overflow
Αξία | Περιγραφή |
---|---|
overflow | Ορίζει τι θα συμβεί αν το περιεχόμενο υπερβεί το μέγεθος του περιεχομένου του στοιχείου. |
overflow-x | Ορίζει πώς θα χειριστούν τα περιεχόμενα στις άκρες του περιεχομένου του στοιχείου όταν υπερβαίνει το μέγεθος του περιεχομένου του στοιχείου. |
overflow-y | Ορίζει πώς θα χειριστούν τα περιεχόμενα στις άκρες του περιεχομένου του στοιχείου όταν υπερβαίνει το μέγεθος του περιεχομένου του στοιχείου. |
- Επόμενη Σελίδα CSS z-index
- Προηγούμενη Σελίδα CSS Πλεκτά