DCSIMG
What is new in IE9 - border-radius - שלמה גולדברג (הרב דוטנט)

שלמה גולדברג (הרב דוטנט)

מרצה בסלע ויועץ בעולם ה - net.

What is new in IE9 - border-radius

 

אחרי סדרת פוסטים על IE8 כמדומני שהגיע הזמן להתחיל לכתוב גם על IE9.

 
 
הפעם נכתוב על מאפיין חדש שנקרא border-radius.
 
 
הרבה זמן חפשנו את האופצייה לעגל פינות של אלמנטים ב - html, היינו שמים תמונות או משתמשים בפקדים חיצוניים כמו RoundedCorners של ajax ואחרים.
 
בעזרת המאפיין החדש נוכל לעגל כל אלמנט DOM שנרצה. לדוגמה הקוד הבא
 
 

<div class="outer">

    <div class="inner">

        shlomo<br />

        shlomo shlomo<br />

        shlomo shlomo<br />

        shlomo shlomo<br />

        shlomo shlomo<br />

        shlomo

    </div>

</div>

 

<style type="text/css">

    body

    {

        background-color: #4dc3e1;

        font-family: Arial;

    }

    .outer

    {

        border-color: White;

        border-width: 2px;

        border-style: solid;

        width: 250px;

        border-radius: 10px 10px 0px 0px;

        text-align: center;

    }

 

    .inner

    {

        border-width: 10px;

        border-radius: 7px 7px 0px 0px;

        border-color: #ff711a;

        border-style: solid;

        padding: 10px;

    }

</style>

 
בדפדפנים ישנים יתן את התוצאה הבאה.
 
Border-Radius in ie8
 
ואילו ב - IE9 יתן את התוצאה הבאה
 
Border raduis in ie9
 
 
 
דוגמא נוספת.
הקוד הבא
 

<div class="buttonOuter">

    <input type="button" value="My Button" class="buttonInner" />

</div>

 

 

.buttonOuter

{

    border-color: White;

    border-width: 4px;

    border-style: solid;

    width: 150px;

    border-radius: 10px;

    text-align: center;

}

 

.buttonInner

{

    border-width: 2px;

    border-radius: 7px;

    border-color: Black;

    border-style: solid;

    width:150px;

    background-color:White;

    padding:3px;

}

 
בדפדפנים ישנים יחזיר תוצאה כזאת
 
Button IE8
 
וב - IE9 יחזיר את התוצאה הבאה
 
Button IE9
 
 
אפשר לעשות עם זה גם דברים מטורפים כמו הדוגמא הבאה (שלקוחה מה - Internet Explorer Platform Preview שאני ארחיב עליו בפוסט הבא)
 
שימו לב לקוד הבא
 
 

<div id="ie-logo">

    <div id="e-top">

    </div>

    <div id="e-bottom">

        <div id="e-cut">

        </div>

    </div>

    <div id="ring">

    </div>

</div>

 

 

#e-top

{

    border: 2px solid #2b5ff8;

    height: 58px;

    width: 90px;

    border-width: 50px 80px 17px 80px;

    border-radius: 120px 120px 0px 0px;

}

 

#e-bottom

{

    border: 5px solid #2b5ff8;

    height: 58px;

    width: 90px;

    border-width: 17px 80px 50px 80px;

    border-radius: 0px 0px 120px 120px;

}

 

#e-cut

{

    margin-left: 75px;

    width: 100px;

    height: 20px;

    border: none dotted black;

    background-color: #ebebeb;

}

 

#ring

{

    margin-top: -250px;

    width: 240px;

    height: 270px;

    border: solid orange;

    border-width: 12px 0px 0px 24px;

    border-radius: 400px 100px 400px 100px;

}

 

#ie-logo

{

    display: block;

    width: 250px;

    height: 250px;

    margin: 0 auto 10px auto;

    padding: 50px;

    background-color: #ebebeb;

    border-radius: 25px;

}

 
 
בדפדפנים ישנים
 
IE-Logo in ie8
 
ב - IE9
 
 
IE-Logo in ie9
שלח תגובה

(שדה חובה)  

(שדה חובה)  

(אופציונלי)

(שדה חובה) 

Please add 7 and 4 and type the answer here:


Enter the numbers above: