Wednesday, June 26, 2013

Create blinking alertbar using css3


Want to create a area attracted or catchy?Nice blinking alertbox is your best option.you can do easily using css3 animations.



1.HTML

  <section id="alertbox"><span>this is a alert</span> </section>
 This is very simple html code.hope you understand this.i used html5.as everyone is crazy about it right now.you can use a simple div if you want.

2.CSS3

Css code is below

body{
                background-color: #000;
            }
            #alertbar{
                width: 800px;/* width of the alert box */
                height: 30px;/* height of the alert box*/
                margin-left: 200px;
                background-color: #fff;
                  border-radius:3px;
 -moz- border-radius:3px;
 -webkit-border-radius:3px;
 -o- border-radius: 3px;
     animation: alert 1.5s infinite;/* css3 Animation name is alert 1.5 is animation time infinite- is no. of time this animation will run */
-moz-animation: alert 1.5s infinite; /* Firefox */
-webkit-animation: alert 1.5s infinite; /* Safari and Chrome */
-o-animation: alert 1.5s infinite; /* Opera */
-moz-box-shadow: 2px 0px 3px rgb(0, 0, 0);
    -webkit-box-shadow: 2px 0px 3px rgb(0, 0, 0);
    box-shadow: 2px 0px 3px rgb(0, 0, 0);
        margin-top: 100px;
        text-align:center;
   
            }
            /* this alert text styling */
            #alertbar span{
    margin-top: 3px;
    display: block;
    padding-top: 3px!important;
    vertical-align:middle;
    text-transform: capitalize;
    color: #ddd;
}
/* alert animation*/
            @keyframes alert
{
0%   {background:#161616;}

100% {background: #0181EB;}
}

@-moz-keyframes alert /* Firefox */
{
0%   {background: #161616;}

100% {background: #0181EB;}
}
@-o-keyframes alert /* Firefox */
{
0%   {background: #161616;}

100% {background: #0181EB;}
}
@-webkit-keyframes alert
{
0%   {background: #161616;}

100% {background: #0181EB;}
}
This is basic css you need to create the animation.

Understand  the css

  1.  I used a simple css animation that finishes in 1.5 sec.it just changes the background color.You can check out w3school to understand css3 animation.
  2. Alert is the animation name i created.
  3. The animation  repeats  infinite time.if you want to run the animation for specific number of times.just replace infinite in css to number.
  4. #161616 and #0181EB are the color code i used in the animation. you can change it if you want.
Its very simple i guess.let me know you liked it or not. 

Bye bye for now.

15 comments:

  1. Gclub8 คาสิโน รูปแบบใหม่ เปิด ให้บริการ 24 ชั่วโมง ด้วยระบบ ฝาก ถอนเงินแบบออโต้ PGSLOT จึงทำให้ได้รับความนิยม เว็บไซต์ คาสิโน ชั้น 1 อาณาจักรมีเพรียบ และ กองทัพเกมส์ เยอะมากนานา

    ReplyDelete
  2. winslot888 มันคืออะไรประสบการณ์การเล่นเกมที่มีความสนุกสนานและเพลิดเพลินไปกับการเล่นสล็อตออนไลน์ นอกจากนี้ยังมีโอกาสได้รับรางวัลและโบนัสมากมาย ซึ่งทำให้ PG SLOT

    ReplyDelete
  3. pg slot asia สล็อต เป็นเว็บไซต์พนันสล็อตออนไลน์ ลำดับหนึ่ง ที่คนอีกหลายๆคนนั้นต้องเคยได้ฟังชื่อนี่กันมาบ้างแล้วเพราะเว็บไซต์ของพวกเรานั้น PG SLOT เปิดให้บริการโกรธยะหนึ่ง

    ReplyDelete
  4. เข้า เล่น pg พีจีสล็อต รองรับโทรศัพท์เคลื่อนที่ทุกระบบ เล่นได้ทุกหนทุกแห่ง แบบเกมนั้น ” รองรับภาษาไทย “ เป็นเกมสล็อตรูปแบบใหม่ pg slot พาทางเข้าเล่นมาให้คุณแล้วคลิกได้เลย

    ReplyDelete
  5. pgslot ลองเล่นฟรี ผู้อ่านทุกท่านคงจะเคยได้ยินเรื่องของการเล่นเกมสล็อตออนไลน์กันมาบ้างแล้วใช่ไหมละ? แต่ละคนอาจจะเคยเล่นกับเว็บไซต์ต่างๆใน PG SLOT

    ReplyDelete
  6. สล็อต PGSLOTแตกง่าย เล่นง่ายได้เงินจริงผู้ให้บริการเกมสล็อต pg slot ออนไลน์บนโทรศัพท์เคลื่อนที่ที่มีเกมนานาประการให้เลือก เป็นเกมรูปแบบใหม่ที่ทำเงินให้ผู้เล่นได้เงินจริง 

    ReplyDelete
  7. PG-Gameslotช่วยเขียนโพสต์เท่านั้นค่ะ สำหรับคำถามนี้ เกมส์ที่มีความน่าสนใจและผู้เล่นนิยมเล่นใน PG SLOT นั้น มีหลากหลายประเภท

    ReplyDelete
  8. ทดลองเล่นบาคาร่าฟรี รวมทุกค่าย ทดสอบเล่นบาคาร่าฟรี รวมทุกค่ายเกมดัง PGSLOT ผู้ให้บริการเว็บไซต์บาคาร่าออนไลน์ ด้วยระบบฝาก-ถอนออโต้ที่รองรับผู้เล่นได้เยอะมากๆเล้นได้ทุกที่

    ReplyDelete
  9. slot pg ทดลอง เล่น เข้าเว็บไซต์ของ PG Slot แล้วคลิกที่ปุ่มทดลองเล่น เพื่อเข้าสู่หน้าเกมสล็อตที่ต้องการเล่นสล็อต PG SLOT

    ReplyDelete
  10. เล่นเกมพรีเมียม PG ผ่าน ไลน์ เมี่ยม ไปกับเราได้ ทำเงินไห้ได้มากที่สุด สำหรับนักเดิมพัน การเล่นเกมผ่างทาง ไลน์ pg-slot.game นั้น เป็นคุณภาพที่ดี PG ได้สำผัสถึงความรู้สึกกับในการเล่นเกม

    ReplyDelete
  11. PGSlotAutogame เป็นเกมสล็อตออนไลน์ที่มีระบบอัตโนมัติในการเล่นทำให้ผู้เล่นไม่ต้องกดปุ่มเพื่อหมุนวงล้อเอง PG SLOT เพียงแค่เลือกเงินเดิมพัน

    ReplyDelete
  12. superpg1688 เป็นค่ายเกมสล็อตออนไลน์ที่มีความปลอดภัยสูงด้วยเหตุว่าเล่นได้นานัปการต้นแบบ เล่นจริง ได้เงินจริง pg slot ลงทะเบียนเป็นสมาชิกค่ายฟรีอย่างเดียวสมาชิกใหม่ที่มาแรง

    ReplyDelete
  13. ทดลองเล่น สล็อตpg สล็อตแมชชีนเป็นงานอดิเรกยอดนิยมมายาวนาน โดยผสมผสานโอกาสและความบันเทิงเข้าด้วยกันเพื่อมอบความตื่นเต้น PG SLOT นานหลายชั่วโมงไม่

    ReplyDelete
  14. สล็อต แตก ง่าย ด้วยความมากมายหลากหลายของตัวเกมที่ได้มีการคัดสรรมาอย่างดีเยี่ยม pg ทำให้ไม่ยุ่งยากต่อการครอบครองรางวัลโบนัส หรือกล่าวได้ว่าเป็น ไม่มีความจำเป็นที่จะต้องมีแนวทาง

    ReplyDelete
  15. pg racha ค่ายเกมสล็อต ออนไลน์ใหม่ ปัจจุบัน 2023 pg slot ระบบเกมสล็อต แล้วก็คาสิโนสดที่เยี่ยมที่สุด พร้อมเปิดให้บริการทุกค่าย เกม ซื้อฟรีสปิน ลุ้นรับรางวัล แจ็คพอต เยอะมาก

    ReplyDelete