473,398 Members | 2,335 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

Design simple popup using CSS/HTML

Hi ALL,

I am developing a website for which I need a popup which will display information. I need this popup to be designed in CSS / HTML.

I am ASP.NET developer and not a designer, although I have basic knowledge of of HTML and CSS. But, not able to figure out how to design such a popup.

It would be great if anyone help me to achieve this.

For your reference I have attached a popup screen shot which I took from some other website...(I don't need exactly same popup, but somewhat similar).

Thanks in Advance

Swapnil
Attached Images
File Type: jpg PopUp.jpg (20.4 KB, 622 views)
Aug 13 '13 #1
4 3961
Exequiel
288 256MB
HTML :
Expand|Select|Wrap|Line Numbers
  1. <div id="popup_main_bg" align="center" style="/*display:none;*/">
  2. <div id="pop_msg" align="justify" style="display:none;"></div>
  3.     <div id="popup_content">
  4.     <div id="help_desk_header" align="justify">
  5.         <span id="poptitle"></span>    <span id="closepop" onClick="closepop()"> x </span>
  6.     </div>
  7.     <div id="popup_content_data" align="justify">
  8.  
  9.     </div>
  10.     <hr id="hhr">
  11.  
  12.     <div id="buttonzzx">
  13.         <input type="submit" form="form_ticket" id="savehelp" value="Save" style="padding: 5px; font-weight:bold; float:right; margin-left:4px;" onClick="savehelp()">
  14.         <input type="reset" value="Reset" onClick="reset_me()" style="padding: 5px; font-weight:bold; float:right;">
  15.     </div>
  16.     <div style="padding:0; clear:both;"></div>
  17.     <br>
  18.     </div><!-- popup_content -->
  19. </div>
CSS :
Expand|Select|Wrap|Line Numbers
  1. <style>
  2. #popup_main_bg{
  3.     width:100%; height:100%; background: rgba(102,102,102,0.4); position:fixed; z-index:500;
  4.     }
  5. #help_desk_header{
  6.     font-size: 13px;
  7.     border:1px solid #BFBFBF;
  8.     padding:5px;
  9.     border-radius: 5px;
  10.     text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
  11.     cursor: move;
  12.     background: rgb(238,238,238); /* Old browsers */
  13.     background: -moz-linear-gradient(top,  rgba(238,238,238,1) 0%, rgba(204,204,204,1) 100%); /* FF3.6+ */
  14.     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(238,238,238,1)), color-stop(100%,rgba(204,204,204,1))); /* Chrome,Safari4+ */
  15.     background: -webkit-linear-gradient(top,  rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%); /* Chrome10+,Safari5.1+ */
  16.     background: -o-linear-gradient(top,  rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%); /* Opera 11.10+ */
  17.     background: -ms-linear-gradient(top,  rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%); /* IE10+ */
  18.     background: linear-gradient(to bottom,  rgba(238,238,238,1) 0%,rgba(204,204,204,1) 100%); /* W3C */
  19.     filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#eeeeee', endColorstr='#cccccc',GradientType=0 ); /* IE6-9 */
  20.     }
  21. #help_desk_header span#poptitle{    
  22.     font-size: 12px;
  23.     font-weight:bold;
  24.     text-shadow: 1px 1px 1px rgba(255,255,255,0.8);
  25.     }
  26. #popup_content{
  27.     padding:2px;
  28.     background:#fff;
  29.     border:1px solid #8A8A8A;
  30.     width: 500px;
  31.     border-radius: 5px;
  32.     }
  33. #popup_content_data{
  34.     background:#fff;
  35.     padding: 0;
  36.     min-height: 300px;
  37.     padding-top: 5px;
  38.     }
  39. #popup_content input[typebutton],
  40. #popup_content input[type=reset],
  41. #popup_content input[type=submit],
  42. #popup_content button{
  43.     border: 1px solid #B4B4B4;
  44.     cursor:pointer;
  45.     border-radius: 3px;
  46.     font-size: 14px;
  47.     box-shadow:0px 1px 1px rgba(1,1,1,0.2);
  48.     background: rgb(215,222,227); /* Old browsers */
  49.     background: -moz-linear-gradient(top,  rgba(215,222,227,1) 0%, rgba(245,247,249,1) 52%, rgba(215,222,227,1) 100%); /* FF3.6+ */
  50.     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(215,222,227,1)), color-stop(52%,rgba(245,247,249,1)), color-stop(100%,rgba(215,222,227,1))); /* Chrome,Safari4+ */
  51.     background: -webkit-linear-gradient(top,  rgba(215,222,227,1) 0%,rgba(245,247,249,1) 52%,rgba(215,222,227,1) 100%); /* Chrome10+,Safari5.1+ */
  52.     background: -o-linear-gradient(top,  rgba(215,222,227,1) 0%,rgba(245,247,249,1) 52%,rgba(215,222,227,1) 100%); /* Opera 11.10+ */
  53.     background: -ms-linear-gradient(top,  rgba(215,222,227,1) 0%,rgba(245,247,249,1) 52%,rgba(215,222,227,1) 100%); /* IE10+ */
  54.     background: linear-gradient(to bottom,  rgba(215,222,227,1) 0%,rgba(245,247,249,1) 52%,rgba(215,222,227,1) 100%); /* W3C */
  55.     filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#d7dee3', endColorstr='#d7dee3',GradientType=0 ); /* IE6-9 */
  56.  
  57.     }
  58. #popup_content input[typebutton]:hover,
  59. #popup_content input[type=reset]:hover,
  60. #popup_content input[type=submit]:hover,
  61. #popup_content button:hover{
  62.     background: rgb(188,193,198); /* Old browsers */
  63.     background: -moz-linear-gradient(top,  rgba(188,193,198,1) 0%, rgba(237,238,239,1) 52%, rgba(188,193,198,1) 99%); /* FF3.6+ */
  64.     background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(188,193,198,1)), color-stop(52%,rgba(237,238,239,1)), color-stop(99%,rgba(188,193,198,1))); /* Chrome,Safari4+ */
  65.     background: -webkit-linear-gradient(top,  rgba(188,193,198,1) 0%,rgba(237,238,239,1) 52%,rgba(188,193,198,1) 99%); /* Chrome10+,Safari5.1+ */
  66.     background: -o-linear-gradient(top,  rgba(188,193,198,1) 0%,rgba(237,238,239,1) 52%,rgba(188,193,198,1) 99%); /* Opera 11.10+ */
  67.     background: -ms-linear-gradient(top,  rgba(188,193,198,1) 0%,rgba(237,238,239,1) 52%,rgba(188,193,198,1) 99%); /* IE10+ */
  68.     background: linear-gradient(to bottom,  rgba(188,193,198,1) 0%,rgba(237,238,239,1) 52%,rgba(188,193,198,1) 99%); /* W3C */
  69.     filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#bcc1c6', endColorstr='#bcc1c6',GradientType=0 ); /* IE6-9 */
  70.     }
  71. #popup_content input[typebutton]:active,
  72. #popup_content input[type=reset]:active,
  73. #popup_content input[type=submit]:active,
  74. #popup_content button:active{
  75.     box-shadow: inset 0px 1px 2px 2px rgba(1,1,1,0.3);
  76.     }
  77. #closepop{
  78.     font-weight:bold;
  79.     font-size:16px;
  80.     float:right;
  81.     padding-bottom:2px;
  82.     padding-left: 7px;
  83.     padding-right: 7px;
  84.     margin-top:-4.5px;
  85.     line-height: 18px;
  86.     border-radius: 3px;
  87.     cursor:pointer;
  88.     border: 1px solid rgba(1,1,1,0);
  89.     }    
  90. #closepop:hover{
  91.     background: rgba(255,255,255,0.6);
  92.     border: 1px solid rgba(255,255,255,0.6);
  93.     color: #333;
  94.     box-shadow: inset 0px 1px 1px 2px rgba(1,1,1,0.2);
  95.     }
  96. #support_search_area{
  97.     padding:5px;
  98.     background: rgb(228,245,252); /* Old browsers */
  99. background: -moz-linear-gradient(top, rgba(228,245,252,1) 0%, rgba(191,232,249,1) 47%, rgba(159,216,239,1) 51%, rgba(42,176,237,1) 100%); /* FF3.6+ */
  100. background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(228,245,252,1)), color-stop(47%,rgba(191,232,249,1)), color-stop(51%,rgba(159,216,239,1)), color-stop(100%,rgba(42,176,237,1))); /* Chrome,Safari4+ */
  101. background: -webkit-linear-gradient(top, rgba(228,245,252,1) 0%,rgba(191,232,249,1) 47%,rgba(159,216,239,1) 51%,rgba(42,176,237,1) 100%); /* Chrome10+,Safari5.1+ */
  102. background: -o-linear-gradient(top, rgba(228,245,252,1) 0%,rgba(191,232,249,1) 47%,rgba(159,216,239,1) 51%,rgba(42,176,237,1) 100%); /* Opera 11.10+ */
  103. background: -ms-linear-gradient(top, rgba(228,245,252,1) 0%,rgba(191,232,249,1) 47%,rgba(159,216,239,1) 51%,rgba(42,176,237,1) 100%); /* IE10+ */
  104. background: linear-gradient(to bottom, rgba(228,245,252,1) 0%,rgba(191,232,249,1) 47%,rgba(159,216,239,1) 51%,rgba(42,176,237,1) 100%); /* W3C */
  105. filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#e4f5fc', endColorstr='#2ab0ed',GradientType=0 ); /* IE6-9 */
  106.     }
  107.  
  108. #pop_msg{
  109.     position:absolute;
  110.     padding: 8px;
  111.     border-radius:5px;
  112.     min-width: 300px;
  113.     max-width: 400px;
  114.     font-size: 15px;
  115.     display:none;
  116.     font-weight:bold;
  117.     margin-left: 50px;
  118.     margin-top: 100px;
  119.     z-index: 550;
  120.     text-shadow:0px 1px 1px rgba(1,1,1,0.3);
  121.     box-shadow:0px 1px 2px rgba(1,1,1,0.4);
  122.     }
  123. .errormsg{
  124.     background:/*#FF9F9Frgba(0,0,0,0.7)*/ rgba(255,98,98,0.8);
  125.     border: 1px solid /*#FF4A4A*/ rgba(255,81,81,0.9);
  126.     color:#FFF;
  127.     }
  128. .successmsg{
  129.     background:/*#FF9F9F*/ rgba(0,196,0,0.8);
  130.     border: 1px solid /*#FF4A4A*/ rgba(0,253,0,1);
  131.     color:#FFF;
  132.     }
  133. </style>
  134.  
  135.  
try that one. . .
to close or show that popup use javascript or jquery. . .
Aug 13 '13 #2
Hi,

thanks for prompt reply.

Code provided by you is working fine in all browsers but IE.

In IE sync is off..

In I.E. Close button is jumping off the "poptitle" DIV.
Aug 13 '13 #3
Exequiel
288 256MB
hehe. . . thats my problem too. . . try it in IE9 above. . .
Aug 13 '13 #4
Hey If you need to display a customize way to display your pop up you can use this:--
Expand|Select|Wrap|Line Numbers
  1. <html>
  2.  
  3. <body>
  4.  
  5. <style type="text/css">
  6. #lightbox {
  7.     display:none;
  8.     background:#000000;
  9.     opacity:0.9;filter:alpha(opacity=90);
  10.     position:absolute;
  11.     top:0px;
  12.     left:0px;
  13.     min-width:100%;
  14.     min-height:100%;
  15.     z-index:1000;
  16.  
  17. #contact-us-lightbox-panel {
  18.     display:none;
  19.     position:fixed;
  20.     top:100px;
  21.     left:20%;
  22.     margin-left:0px;
  23.     width:900px;
  24.     background:#FFFFFF;
  25.     padding:7px;
  26.     border:2px solid #CCCCCC;
  27.     z-index:1001;
  28. }
  29.  
  30. #contact-us-lightbox-panel #headerbar-lightbox-panel{
  31.     width: 904px;
  32. }
  33.  
  34. #contact-us-lightbox-panel #contents_for_address{
  35.     background-color: #a6a6a6;
  36.     width: 904px;
  37.     height: 70px;
  38.     margin-top: 10px;
  39. }
  40.  
  41. #contact-us-lightbox-panel #contents_for_address #left{
  42.     float: left;
  43.     margin-left: 50px;
  44.     font-family: Helvetica;
  45.     font-size: 14px;
  46. }
  47.  
  48. #contact-us-lightbox-panel #contents_for_address #left img{
  49.     position: absolute;
  50.     left: 25px;
  51. }
  52.  
  53. #contact-us-lightbox-panel #contents_for_address #right{
  54.     margin-left: 500px;
  55.     font-family: Helvetica;
  56.     font-size: 14px;
  57. }
  58.  
  59. #contact-us-lightbox-panel #contents_for_write_to_us{
  60.     margin-top: 10px;
  61. }
  62.  
  63. #contact-us-lightbox-panel #contents_for_write_to_us textarea{
  64.     width: 880px; 
  65.     height: 150px;
  66. }
  67.  
  68. </style>
  69. <div class="Clickme">ClickMe</div>
  70. <div id="contact-us-lightbox-panel">  
  71.     <div id="headerbar-lightbox-panel"></div>
  72.     <div class="close-panel"><a href="#">X</a></div>
  73.     <div id="contents_for_address">
  74.         <div id="left">
  75.  
  76.             <p>Call Us :</p>
  77.             <p>Office number :0000000</p>
  78.             <p>Toll Free : 0000000</p>
  79.         </div>
  80.         <div id="right">
  81.             <p>Address :</p>
  82.             <p>asdasdsadasd</p>
  83.             <p>dsadasdasdsadas</p>
  84.         </div>
  85.     </div>
  86.     <div id="contents_for_write_to_us">
  87.         <p>Write To Us(Characters 600 Limit)</p>
  88.         <textarea></textarea>
  89.     </div>
  90.     <button class="save-pop">Submit</button>
  91.     <button class="save-pop">Reset</button>
  92. </div>
  93. <div id="lightbox"></div>  
  94.  
  95. <script src="js/jquery.min.js"></script>
  96. <script type="text/javascript">
  97. $(document).ready(function(){
  98.   $(".Clickme").click(function(){
  99.     $("#lightbox, #contact-us-lightbox-panel").fadeIn(300); 
  100.   });
  101.    $(".close-panel").click(function(){  
  102.     $("#lightbox, #contact-us-lightbox-panel").fadeOut(300);   
  103.   });
  104.      $(".save-pop").click(function(){  
  105.     $("#lightbox, #contact-us-lightbox-panel").fadeOut(300);   
  106.   });
  107. });
  108.  
  109. </script>
  110. </body>
  111.  
  112. <html>
  113.  

Make sure you import the jquery library .........lemme know if its working
Aug 23 '13 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Himanshu Garg | last post by:
Hello, I am using HTML::Parser to extract text from html pages from http://bbc.co.uk/urdu/ However the encoding of the input text seems to change to some unknown encoding in the output. The...
1
by: Mosher | last post by:
Hi all, is there a good way to have a popup window appear using Javascript and the html "map" tag? Here is my code: <map name="navigation"> <area shape="rect" coords="5,57,45,70"...
15
by: Nathan | last post by:
I have an aspx page with a data grid, some textboxes, and an update button. This page also has one html input element with type=file (not inside the data grid and runat=server). The update...
6
by: VishalK | last post by:
Friends.. I have a HTML file. Using HTML Code, I want to change its file extension from .html to .mht. eg : TestFile.html to be converted to TestFile.mht Anybody has any idea about this ? Please...
5
by: aniltc | last post by:
Hi all I am new to websites and its concepts.I have to implement multilanguage facility in both English and German.I am not using any server side Scripting Lnaguage.I use only HTML ...
2
by: Dabulsta | last post by:
I am trying to design a network using Windows Server 2003 Active Directory infrastructure for the following company(below) and I was wondering if there was some sort of walk through available to...
19
Atli
by: Atli | last post by:
Introduction At some point, all web developers will need to collect data from their users. In a dynamic web page, everything revolves around the users input, so knowing how to ask for and collect...
1
by: psbasha | last post by:
Hi, Is it possible to create a simple viewer using Tkinter Modueles?. If not ,is it possible thru Python and OpenGL or anyother ways of creating a simple viewer?. I would like to have the...
3
by: happyse27 | last post by:
Hi All, I am creating the perl script using html form(with embedded javascript inside). When using this html form with javascript alone, it works where the form validation will pop up...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.