Set a Grey Border to an Element in Bootstrap 4

Ricky Barnes
Updated on 16-Jun-2020 12:28:08

518 Views

Set a grey border to an element, using the border-secondary class in Bootstrap 4.Add it like the following example − I have also included the “mystyle” class to style the div − .mystyle {   width: 250px;   height: 150px;   margin: 10px; } Let us see an example to implement the border-secondary class −ExampleLive Demo       Bootstrap Example                             .mystyle {       width: 250px;       height: 150px;       margin: 10px;      }           Shape   Rectangle with gray border

Important HTTP Headers in Python CGI Programming

Rajendra Dharmkar
Updated on 16-Jun-2020 12:25:28

390 Views

HTTP HeaderThe line Content-type:text/html\r\r is part of HTTP header which is sent to the browser to understand the content. All the HTTP header will be in the following form −HTTP Field Name − Field ContentFor ExampleContent-type − text/html\r\rThere are few other important HTTP headers, which we will use frequently in our CGI Programming.     Sr.No.HeaderDescription1Content-type:A MIME string defining the format of the file being returned. Example is Content-type:text/html2Expires: DateThe date the information becomes invalid. It is used by the browser to decide when a page needs to be refreshed. A valid date string is in the format 01 Jan 1998 ... Read More

Bootstrap 4 Border Success Class

Amit Diwan
Updated on 16-Jun-2020 12:23:14

241 Views

Display a green border to an element in Bootstrap that indicates success using the border-success class.Set the border as green −    Green border I have also added “mystyle” class in the div, which is to style our div, a rectangle in my example −.mystyle {   width: 250px;   height: 150px;   margin: 10px; }Implement the border-success as shown below −ExampleLive Demo       Bootstrap Example                             .mystyle {       width: 250px;       height: 150px;       margin: 10px;     }   Shape   Green border

Modules Required for CGI Programming in Python

Rajendra Dharmkar
Updated on 16-Jun-2020 12:21:40

318 Views

Python's cgi module is usually the starting place in writing CGI programs in Python. The main purpose of the cgi module is to extract the values passed to a CGI program from an HTML form. Mostly one interacts with CGI applications through an HTML form. One fills out some values in the form that specify details of the action to be performed, then call on the CGI to perform its action using your specifications.You may include many input fields within an HTML form which can be of a number of different types (text, checkboxes, picklists, radio buttons, etc.).Your Python script ... Read More

Set Negative Action for Bootstrap 4 Cards with Red Background Color

Amit Diwan
Updated on 16-Jun-2020 12:20:59

277 Views

To set negative action (danger) for cards with red background color, you need to use the Bootstrap contextual class card-danger.Set the danger action −   Danger! High Voltage! You can try to run the following code to set danger action for a card in Bootstrap 4 −ExampleLive Demo       Bootstrap Example                             Messages           How you doing?               Danger! High Voltage!      

Create a Grid of Bootstrap 4 Cards of Equal Height and Width

Amit Diwan
Updated on 16-Jun-2020 12:18:58

557 Views

Set a container of cards, using the card-deck class.Work it inside the following div that would be of equal width and height −         You can try to run the following code to implement the card-deck class −ExampleLive Demo       Bootstrap Example                             Demo Messages     Note: Resize the browser to check the effect.                           Nothing new!                            Warning! Compile-time error!          Check again!                            We won!            

Pass Text Area Data to Python CGI Script

Rajendra Dharmkar
Updated on 16-Jun-2020 12:18:43

873 Views

Passing Text Area Data to CGI ProgramTEXTAREA element is used when multiline text has to be passed to the CGI Program.Here is example HTML code for a form with a TEXTAREA box − Type your text here... The result of this code is the following form −Type your text here...  SubmitBelow is textarea.cgi script to handle input given by web browser −#!/usr/bin/python # Import modules for CGI handling import cgi, cgitb # Create instance of FieldStorage form = cgi.FieldStorage() # Get data from fields if form.getvalue('textcontent'):    text_content = form.getvalue('textcontent') else:    text_content = "Not entered" print ... Read More

Pass Checkbox Data to Python CGI Script

Rajendra Dharmkar
Updated on 16-Jun-2020 12:17:52

597 Views

Passing Checkbox Data to CGI ProgramCheckboxes are used when more than one option is required to be selected.Here is example HTML code for a form with two checkboxes − Maths Physics The result of this code is the following form −Maths  Physics Select SubjectBelow is checkbox.cgi script to handle input given by web browser for checkbox button.#!/usr/bin/python # Import modules for CGI handling import cgi, cgitb # Create instance of FieldStorage form = cgi.FieldStorage() # Get data from fields if form.getvalue('maths'):    math_flag = "ON" else:    math_flag = "OFF" if form.getvalue('physics'):    physics_flag = "ON" else: ... Read More

Align Items in the Center on Different Screens in Bootstrap 4

Amit Diwan
Updated on 16-Jun-2020 12:17:01

201 Views

Use .align-content-*-center class to align gathered items in the center on different screens in Bootstrap 4.Here is how you can align gathered items in the center on different screens −Small Screen SizeMedium Screen SizeLarge Screen SizeYou can try to run the following code to align gathered items in the center on different screens in Bootstrap 4 −ExampleLive Demo      Bootstrap Example                         Example       One     Two     Three     Four     Five     Six ... Read More

Pass Radio Button Data to Python CGI Script

Rajendra Dharmkar
Updated on 16-Jun-2020 12:16:41

1K+ Views

Passing Radio Button Data to CGI ProgramRadio Buttons are used when only one option is required to be selected.Here is example HTML code for a form with two radio buttons − Maths Physics The result of this code is the following form − Maths  Physics Select SubjectBelow is radiobutton.py script to handle input given by web browser for radio button −#!/usr/bin/python # Import modules for CGI handling import cgi, cgitb # Create instance of FieldStorage form = cgi.FieldStorage() # Get data from fields if form.getvalue('subject'):    subject = form.getvalue('subject') else:    subject = "Not set" print "Content-type:text/html\r\r" print ... Read More

Advertisements