

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Set the width of an element to 25% in Bootstrap
To set the width of an element to 25%, use the .w-25 class in Bootstrap.
You can try to run the following code to set element’s width
Example
<!DOCTYPE html> <html> <head> <title>Bootstrap Example</title> <link rel = "stylesheet" href = "https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/css/bootstrap.min.css"> <script src = "https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script> <script src = "https://maxcdn.bootstrapcdn.com/bootstrap/4.1.1/js/bootstrap.min.js"></script> </head> <body> <div class = "container"> <h3>Set element width</h3> <div class = "w-100 bg-danger">Normal width</div> <div class = "w-50 bg-success">Width is 50%</div> <div class = "w-25 bg-warning">Width is 25%</div> </div> </body> </html>
- Related Questions & Answers
- Set the width of an element to 75% in Bootstrap
- Set the width of an element to 100% in Bootstrap
- Set the width of an element to 50% in Bootstrap 4
- How to set the width of an element in JavaScript?
- How to set the maximum width of an element with JavaScript?
- How to set the minimum width of an element with JavaScript?
- Set min-width and max-width of an element using CSS
- Set the width of the element in HTML
- How to set the width of the outline around an element with JavaScript?
- How to set width and height of an element using jQuery?
- How to set the width of an element's border with JavaScript?
- Set the width and margin of the modal with Bootstrap
- Set a dark border to an element in Bootstrap
- Set a blue border to an element in Bootstrap
- Set a white border to an element in Bootstrap
Advertisements