What is Bootstrap Grid System? Bootstrap grid system provides an easy and powerful way to create responsive layouts of all shapes and sizes. It is built with flexbox with mobile-first approach. Also, it is fully responsive and uses twelve column system (12 columns available per row) and six default responsive tiers. You can use the Bootstrap’s predefined grid classes for quickly making the layouts for different types of devices like mobile phones, tablets, laptops, desktops, and so on. For example, you can use the .col-* classes to create grid columns for extra small devices like mobile phones in portrait mode, and the .col-sm-* classes for mobile phones in landscape mode. Similarly, you can use the .col-md-* classes to create grid columns for medium screen devices like tablets, the .col-lg-* classes for devices like small laptops, the .col-xl-* classes for laptops and desktops, and the .col-xxl-* classes for large desktop screens. The following table summarizes the key features of the Bootstrap’s grid system. FeaturesBootstrap Grid System X-Small (xs)<576px Small (sm)≥576px Medium (md)≥768px Large (lg)≥992px X-Large (xl)≥1200px XX-Large (xxl)≥1400px Container max-width None (auto) 540px 720px 960px 1140px 1320px Class prefix .col- .col-sm- .col-md- .col-lg- .col-xl- .col-xxl- Number of columns 12 Gutter width 1.5rem (.75rem on left and right) Custom gutters Yes Nestable Yes Column ordering Yes Above table demonstrates one important thing, applying any .col-sm-* class to an element will not only have an effect on small devices, but also on medium, large and extra large devices (viewport width ≥768px), if a .col-md-*, .col-lg-*, .col-xl-*, or .col-xxl-* class is not present. Similarly, the .col-md-* class will not only have an effect on medium devices, but also on large and extra large devices if a .col-lg-*, .col-xl-*, or .col-xxl-* class is not present. Now the question arises how to create rows and columns using this 12 column responsive grid system. The answer is pretty simple, at first create a container that acts as a wrapper for your rows and columns using any container classes such as .container, after that create rows inside the container using the .row class, and to create columns inside any row you can use the .col-*, .col-sm-*, .col-md-*, .col-lg-*, .col-xl-* and .col-xxl-* classes. The columns are actual content area where we will place our contents. In the following sections we will put all these things into real action and see how it actually works: Creating Two Column Layouts The following example will show you how to create two column layouts for medium, large and extra large devices like tables, laptops and desktops etc. However, on mobile phones (screen width less than 768px), the columns will automatically become horizontal (2 rows, 1 column). Example Note: In a grid layout, content must be placed inside the columns (.col and .col-*) and only columns may be the immediate children of rows (.row). Also, rows should be placed inside a container (either fixed or fluid) for proper padding and alignment. Tip: Grid column widths are set in percentages, so they’re always fluid and sized relative to their parent element. In addition, each column has horizontal padding (called a gutter) for controlling the space between individual columns. Since the Bootstrap grid system is based on 12 columns, therefore to keep the columns in a one line (i.e. side by side), the sum of the grid column numbers within a single row should not be greater than 12. If you go through the above example code carefully you will find the numbers of grid columns (i.e. col-md-*) add up to twelve (6+6, 4+8 and 3+9) for every row. Creating Three Column Layouts Similarly, you can create other layouts based on the above principle. For instance, the following example will typically create three column layouts for laptops and desktops screens. It also works in tablets in landscape mode if screen resolution is more than or equal to 992 pixels (e.g. Apple iPad). However, in portrait mode the grid columns will be horizontal as usual. Example Note: If more than 12 grid columns are placed within a single row, then each group of extra columns, as a whole, will wrap onto a new line. See column wrapping behavior. Bootstrap Auto-layout Columns You can also create equal width columns for all devices (x-small, small, medium, large, x-large, and xx-large) through simply using the class .col, without specifying any column number. Let’s try out the following example to understand how it exactly works: Example Additionally, you can also set the width of one column and let the sibling columns automatically resize around it equally. You may use the predefined grid classes or inline widths. If you try the following example you’ll find columns in a row with class .col has equal width. Example Column Wrapping Behavior Now we are going to create more flexible layouts that changes the column orientation based on the viewport size. The following example will create a three column layout on large devices like laptops and desktops, as well as on tablets (e.g. Apple iPad) in landscape mode, but on medium devices like tablets in portrait mode (768px ≤ screen width < 992px), it will change into a two column layout where the third column moves at the bottom of the first two columns. Example As you can see in the example above the sum of the medium grid column numbers (i.e. col-md-*) is 3 + 9 + 12 = 24 > 12, therefore the third <div> element with the class .col-md-12 that is adding the extra columns beyond the maximum 12 columns in a .row, gets wrapped onto a new line as one contiguous unit on the medium screen size devices. Similarly, you can create even more adaptable layouts for your websites using the Bootstrap’s grid column wrapping feature. Here’re some ready to use Bootstrap grid examples. Creating Multi-Column Layouts with Bootstrap With the new Bootstrap mobile first flexbox grid system you can easily control how your website layout will render on different types of devices that have different screen or viewport sizes like mobile phones, tablets, desktops, etc. Let’s consider the following illustration. In the above illustration there are total 12 content boxes in all devices, but its placement varies according to the device screen size, like in mobile device the layout is rendered as one column grid layout which has 1 column and 12 rows placed above one another, whereas in tablet it is rendered as two column grid layout which has 2 columns
Bootstrap Containers
Creating Containers with Bootstrap Containers are the most basic layout element in Bootstrap and are required when using the grid system. Containers are basically used to wrap content with some padding. They are also used to align the content horizontally center on the page in case of fixed width layout. Bootstrap provides three different types containers: The table below illustrates how each container’s max-width changes across each breakpoint. For example, when using the .container class the actual width of the container will be 100% if the viewport width is <576px, 540px if the viewport width is ≥576px but <768px, 720px if the viewport width is ≥768px but <992px, 960px if the viewport width is ≥992px but <1200px, 1140px if the viewport width is ≥1200px but <1400px, and 1320px if the viewport width is ≥1400px. Similarly, when you use the .container-lg class the actual width of the container will be 100% until the viewport width is <992px, 960px if the viewport width is ≥992px but <1200px, 1140px if the viewport width ≥1200px but <1400px, and 1320px if the viewport width is ≥1400px. ClassesBootstrap Grid System X-Small<576px Small≥576px Medium≥768px Large≥992px X-Large≥1200px XX-Large≥1400px .container 100% 540px 720px 960px 1140px 1320px .container-sm 100% 540px 720px 960px 1140px 1320px .container-md 100% 100% 720px 960px 1140px 1320px .container-lg 100% 100% 100% 960px 1140px 1320px .container-xl 100% 100% 100% 100% 1140px 1320px .container-xxl 100% 100% 100% 100% 100% 1320px .container-fluid 100% 100% 100% 100% 100% 100% Creating Responsive Fixed-width Containers You can simply use the .container class to create a responsive, fixed-width container. The width of the container will change at different breakpoints or screen sizes, as shown above. Example Creating Fluid Containers You can use the .container-fluid class to create a full width container. The width of the fluid container will always be 100% irrespective of the devices or screen sizes. Example Specify Responsive Breakpoints for Containers Since Bootstrap v4.4, you can also create containers that is 100% wide until the specified breakpoint is reached, after which max-width for each of the higher breakpoints will be applied. For example, .container-xl will be 100% wide until the xl breakpoint is reached (i.e., viewport width ≥ 1200px), after which max-width for xl breakpoint is applied, which is 1140px. Example Adding Background and Borders to Containers By default, container doesn’t have any background-color or border. But if you need you can apply your own styles, or simply use the Bootstrap background-color and border utility classes to add background-color or border on them, as shown in the following example. Example Applying Paddings and Margins to Containers By default, containers have padding of 12px on the left and right sides, and no padding on the top and bottom sides. To apply extra padding and margins you can use the spacing utility classes. Example
Bootstrap Getting Started
Getting Started with Bootstrap In this tutorial you will learn how easy it is to create a web page using Bootstrap. But before begin, be sure to have a code editor and some working knowledge of HTML and CSS. If you’re just starting out in the world of web development, start learning from here » Well, let’s get started creating our first Bootstrap powered web page. Creating Your First Web Page with Bootstrap Now we’re going to create a basic Bootstrap template by including the Bootstrap CSS and JS files via CDN. Bootstrap requires a third-party library Popper.js for some of its components like popovers and tooltips. You can either include it separately or simply include Bootstrap JS bundled with Popper. We recommend adding Bootstrap in your project via CDN (Content Delivery Network) because CDN offers performance benefit by reducing the loading time, since they are hosting the files on multiple servers spread across the globe so that when a user requests the file it will be served from the server nearest to them. We’re also using the CDN links in our examples: Let’s walk through the following steps. At the end of this tutorial, you’ll have made a simple Bootstrap powered web page that displays “Hello world” message in your web browser. Step 1: Creating a Basic HTML file Open up your favorite code editor and create a new HTML file. Start with an empty window and type the following code and save it as “basic.html” on your desktop. Example Tip: Always include the viewport <meta> tag inside the <head> section of your document to enable touch zooming and ensure proper rendering on mobile devices. Step 2: Making this HTML File a Bootstrap Template In order to make this plain HTML file a Bootstrap template, just include the Bootstrap CSS and JS files using their CDN links. Also, you should include JavaScript files at the bottom of the page, right before the closing </body> tag to improve the performance of your web pages. Example And we’re all set! After adding the Bootstrap’s CSS and JS files to our HTML page, we can begin to develop any responsive site or application with the Bootstrap framework. The attributes integrity and crossorigin have been added to CDN links to implement Subresource Integrity (SRI). It is a security feature that enables you to mitigate the risk of attacks originating from compromised CDNs, by ensuring that the files your website fetches (from a CDN or anywhere) have been delivered without unexpected or malicious modifications. It works by allowing you to provide a cryptographic hash that a fetched file must match. Note: The biggest change in Bootstrap 5 is it doesn’t require jQuery anymore. However, you can still use jQuery to quickly implement Bootstrap component’s methods and options. If Bootstrap detects jQuery in the window object it’ll add all of its components in jQuery’s plugin system. You will learn about them in advanced section of this tutorial series. Tip: If the visitor to your website has already downloaded the Bootstrap’s CSS and JS files from the same CDN while visiting the other sites, it will be loaded from the browser’s cache instead of re-downloading, which leads to faster loading time. Step 3: Saving and Viewing the File Now save the file on your desktop as “bootstrap-template.html”. To open this file in a web browser, navigate to it, then right click on it, and select your favorite web browser. Alternatively, you can open your browser and drag this file to it. Note: It is important that the extension .html is specified, some text editors, such as Notepad on Windows, will automatically save it as .txt otherwise. Downloading the Bootstrap Files Alternatively, you can also download the Bootstrap’s CSS and JS files from their official website and include in your project. There are two versions available for download, compiled Bootstrap and Bootstrap source files. You can download Bootstrap 5 files from here. Compiled download contains compiled and minified version of CSS and JavaScript files for faster and easier web development. The compiled version also includes optional JavaScript dependencies such as Popper bundled with Bootstrap JS (bootstrap.bundle.*). Whereas, the source download contains original source files for all CSS and JavaScript, along with a local copy of the docs. Download and unzip the compiled Bootstrap. Now if you look inside the folders you’ll find it contains the compiled CSS and JS files (bootstrap.*), as well as the compiled and minified CSS and JS (bootstrap.min.*). Use the bootstrap.min.css and bootstrap.bundle.min.js files. Using the minified version of CSS and JS files will improve the performance of your website and saves the precious bandwidth because of lesser HTTP request and download size. Tip: There’s no need to include the required Popper.js (in order to make the Bootstrap’s tooltip and popover components work) separately, as it is already included in the “bootstrap.bundle.js” and minified “bootstrap.bundle.min.js” files.
Bootstrap Tutorial
Bootstrap is a powerful front-end framework for faster and easier web development. It includes HTML and CSS based design templates for creating common user interface components like forms, buttons, navigations, dropdowns, alerts, modals, tabs, accordions, carousels, tooltips, and so on. Bootstrap gives you ability to create flexible and responsive web layouts with much less efforts. Bootstrap was originally created by a designer and a developer at Twitter in mid-2010. Before being an open-sourced framework, Bootstrap was known as Twitter Blueprint. You can save a lot of time and effort with Bootstrap. So bookmark this website and continue on. Tip: Our Bootstrap tutorials will help you to learn the basic as well as advanced features of the Bootstrap step-by-step through easy-to-understand explanation of every topic. If you’re a beginner, start with the basics and gradually move forward by learning a little bit every day. What You Can Do with Bootstrap There are lot more things you can do with Bootstrap. The list does not end here, there are many other interesting things that you can do with Bootstrap. You will learn about all of them in detail in upcoming chapters. Advantages of Using Bootstrap If you have had some experience with any front-end framework, you might be wondering what makes Bootstrap so special. Here are some advantages why one should opt for Bootstrap framework: Note: Bootstrap is responsive by default with a mobile first approach. Bootstrap 5 is the latest and most stable version of the Bootstrap. Bootstrap 5 is supported in all major modern browsers such Google Chrome, Firefox, Safari, Internet Explorer 10 and above, etc. What This Tutorial Covers This Bootstrap tutorial series covers all the features of the Bootstrap framework, starting with the basics, such as grid system, typography styling mechanism, form styling methods, as well as, techniques of styling common user interface elements like tables, lists, images, etc. Further you will learn how to utilize the ready to use Bootstrap components such as list groups, input groups, button groups, cards, navbar, breadcrumbs, pagination, labels and badges, progress bars, etc. as well as how to customize them to create their different variations. Finally, you will explore some advanced features of the Bootstrap like creating modal window, dynamic tabs, tooltips, alerts, accordion menu, carousel, scrollspy, etc. as well as how to customize them or extend their existing functionality using the available options and methods.
CSS3 Animations
Creating CSS3 Animations In the previous chapter you’ve seen how to do simple animations like animating a property from one value to another via CSS3 transitions feature. However, the CSS3 transitions provide little control on how the animation progresses over time. The CSS3 animations take it a step further with keyframe-based animations that allow you to specify the changes in CSS properties over time as a set of keyframes, like flash animations. Creating CSS animations is a two step process, as shown in the example below: However, it is not necessary to define the keyframes rules before referencing or applying it. The following example will show you how to animate a <div> box horizontally from one position to another using the CSS3 animation feature. Example You must specify at least two properties animation-name and the animation-duration (greater than 0), to make the animation occur. However, all the other animation properties are optional, as their default values don’t prevent an animation from happening. Note: Not all CSS properties are animatable. In general, any CSS property that accepts values that are numbers, lengths, percentages, or colors is animatable. Defining Keyframes Keyframes are used to specify the values for the animating properties at various stages of the animation. Keyframes are specified using a specialized CSS at-rule — @keyframes. The keyframe selector for a keyframe style rule starts with a percentage (%) or the keywords from (same as 0%) or to (same as 100%). The selector is used to specify where a keyframe is constructed along the duration of the animation. Percentages represent a percentage of the animation duration, 0% represents the starting point of the animation, 100% represents the end point, 50% represents the midpoint and so on. That means, a 50% keyframe in a 2s animation would be 1s into an animation. Example Animation Shorthand Property There are many properties to consider when creating the animations. However, it is also possible to specify all the animations properties in one single property to shorten the code. The animation property is a shorthand property for setting all the individual animation properties at once in the listed order. For example: Example Note: If any value is missing or not specified, the default value for that property will be used instead. That means, if the value for animation-duration property is missing, no transition will occur, because its default value is 0. CSS3 Animation Properties. The following table provides a brief overview of all the animation-related properties. Property Description animation A shorthand property for setting all the animation properties in single declaration. animation-name Specifies the name of @keyframes defined animations that should be applied to the selected element. animation-duration Specifies how many seconds or milliseconds that an animation takes to complete one cycle of the animation. animation-timing-function Specifies how the animation will progress over the duration of each cycle i.e. the easing functions. animation-delay Specifies when the animation will start. animation-iteration-count Specifies the number of times an animation cycle should be played before stopping. animation-direction Specifies whether or not the animation should play in reverse on alternate cycles. animation-fill-mode Specifies how a CSS animation should apply styles to its target before and after it is executing. animation-play-state Specifies whether the animation is running or paused. @keyframes Specifies the values for the animating properties at various points during the animation.
CSS3 Transitions
Understanding CSS3 Transitions Normally when the value of a CSS property changes, the rendered result is instantly updated. A common example is changing the background color of a button on mouse hover. In a normal scenario the background color of the button is changes immediately from the old property value to the new property value when you place the cursor over the button. CSS3 introduces a new transition feature that allows you to animate a property from the old value to the new value smoothly over time. The following example will show you how to animate the background-color of an HTML button on mouse hover. Example To make the transition occur, you must specify at least two things — the name of the CSS property to which you want to apply the transition effect using the transition-property CSS property, and the duration of the transition effect (greater than 0) using the transition-duration CSS property. However, all the other transition properties are optional, as their default values don’t prevent a transition from happening. Note: Not all CSS properties are animatable. In general, any CSS property that accepts values that are numbers, lengths, percentages, or colors is animatable. Performing Multiple Transitions Each of the transition properties can take more than one value, separated by commas, which provides an easy way to define multiple transitions at once with different settings. Example Transition Shorthand Property There are many properties to consider when applying the transitions. However, it is also possible to specify all the transition properties in one single property to shorten the code. The transition property is a shorthand property for setting all the individual transition properties (i.e., transition-property, transition-duration, transition-timing-function, and transition-delay) at once in the listed order. It’s important to stick to this order for the values, when using this property. Example Try this code » Note: If any value is missing or not specified, the default value for that property will be used instead. That means, if the value for transition-duration property is missing, no transition will occur, because its default value is 0. CSS3 Transition Properties The following table provides a brief overview of all the transition properties: Property Description transition A shorthand property for setting all the four individual transition properties in a single declaration. transition-delay Specifies when the transition will start. transition-duration Specifies the number of seconds or milliseconds a transition animation should take to complete. transition-property Specifies the names of the CSS properties to which a transition effect should be applied. transition-timing-function Specifies how the intermediate values of the CSS properties being affected by a transition will be calculated.
CSS3 3D Transforms
3D Transformation of Elements With CSS3 3D transform feature you can perform basic transform manipulations such as move, rotate, scale and skew on elements in a three-dimensional space. A transformed element doesn’t affect the surrounding elements, but can overlap them, just like the absolutely positioned elements. However, the transformed element still takes space in the layout at its default (un-transformed) location. Using CSS Transform and Transform Functions The CSS3 transform property uses the transform functions to manipulate the coordinate system used by an element in order to apply the transformation effect. The following section describes the 3D transform functions: The translate3d() Function Moves the element from its current position to a new position along the X, Y and Z-axis. This can be written as translate(tx, ty, tz). Percentage values are not allowed for third translation-value parameter (i.e. tz). Example The function translate3d(25px, 25px, 50px) moves the image 25 pixels along the positive X and Y-axis, and the 50 pixels along the positive Z-axis. The 3D transform however uses the three-dimensional coordinate system, but movement along the Z-direction is not always noticeable because the elements exist on a two-dimensional plane (a flat surface) and have no depth. The perspective and perspective-origin CSS properties can be used to add a feeling of depth to a scene by making the elements higher on the Z-axis i.e. closer to the viewer appear larger, and those further away to the viewer appear smaller. Note: If you apply 3D transformation to an element without setting the perspective the resulting effect will not appear as three-dimensional. The rotate3d() Function The rotate3d() function rotates the element in 3D space by the specified angle around the [x,y,z] direction vector. This can be written as rotate(vx, vy, vz, angle). Example The function rotate3d(0, 1, 0, 60deg) rotates the image along the Y-axis by the angle 60 degrees. You can use negative values to rotate the element in opposite direction. The scale3d() Function The scale3d() function changes the size of an element. It can be written as scale(sx, sy, sz). The effect of this function is not evident unless you use it in combination with other transform functions such as rotate and the perspective, as shown in the example below. Example The function scale3d(1, 1, 2) scales the elements along the Z-axis and the function rotate3d(1, 0, 0, 60deg) rotates the image along the X-axis by the angle 60 degrees. The matrix3d() Function The matrix3d() function can perform all of the 3D transformations such as translate, rotate, and scale at once. It takes 16 parameters in the form of a 4×4 transformation matrix. Here is an example of performing the 3D transformation using the matrix3d() function. Example However, when performing more than one transformation at once, it is more convenient to use the individual transformation function and list them in order, like this: Example 3D Transform Functions The following table provides a brief overview of all the 3D transformation functions. Function Description translate3d(tx,ty,tz) Moves the element by the given amount along the X, Y & Z-axis. translateX(tx) Moves the element by the given amount along the X-axis. translateY(ty) Moves the element by the given amount along the Y-axis. translateZ(tz) Moves the element by the given amount along the Z-axis. rotate3d(x,y,z, a) Rotates the element in 3D space by the angle specified in the last parameter, around the [x,y,z] direction vector. rotateX(a) Rotates the element by the given angle around the X-axis. rotateY(a) Rotates the element by the given angle around the Y-axis. rotateZ(a) Rotates the element by the given angle around the Z-axis. scale3d(sx,sy,sz) Scales the element by the given amount along the X, Y and Z-axis. The function scale3d(1,1,1) has no effect. scaleX(sx) Scales the element along the X-axis. scaleY(sy) Scales the element along the Y-axis. scaleZ(sz) Scales the element along the Z-axis. matrix3d(n,n,n,n,n,n, n,n,n,n,n,n,n,n,n,n) Specifies a 3D transformation in the form of a 4×4 transformation matrix of 16 values. perspective(length) Defines a perspective view for a 3D transformed element. In general, as the value of this function increases, the element will appear further away from the viewer.
CSS3 2D Transforms
2D Transformation of Elements With CSS3 2D transform feature you can perform basic transform manipulations such as move, rotate, scale and skew on elements in a two-dimensional space. A transformed element doesn’t affect the surrounding elements, but can overlap them, just like the absolutely positioned elements. However, the transformed element still takes space in the layout at its default (un-transformed) location. Using CSS Transform and Transform Functions The CSS3 transform property uses the transform functions to manipulate the coordinate system used by an element in order to apply the transformation effect. The following section describes these transform functions: The translate() Function Moves the element from its current position to a new position along the X and Y axes. This can be written as translate(tx, ty). If ty isn’t specified, its value is assumed to be zero. Example The function translate(200px, 50px) moves the image 200 pixels horizontally along the positive x-axis, and 50 pixels vertically along the positive y-axis. The rotate() Function The rotate() function rotates the element around its origin (as specified by the transform-origin property) by the specified angle. This can be written as rotate(a). Example The function rotate(30deg) rotates the image in clockwise direction about its origin by the angle 30 degrees. You can use negative values to rotate the element counter-clockwise. The scale() Function The scale() function increases or decreases the size of the element. It can be written as scale(sx, sy). If sy isn’t specified, it is assumed to be equal to sx. Example The function scale(1.5) proportionally scale the width and height of the image 1.5 times to its original size. The function scale(1) or scale(1, 1) has no effect on the element. The skew() Function The skew() function skews the element along the X and Y axes by the specified angles. It can be written as skew(ax, ay). If ay isn’t specified, its value is assumed to be zero. Example The function skew(-40deg, 15deg) skews the element -40 degree horizontally along thex-axis, and 15 degree vertically along the y-axis. The matrix() Function The matrix() function can perform all of the 2D transformations such as translate, rotate, scale, and skew at once. It takes six parameters in the form of a matrix which can be written as matrix(a, b, c, d, e, f). The following section will show you how each of the 2D transformation functions can be represented using the matrix(). Here is an example of performing the 2D transformation using the matrix() function. Example However, when performing more than one transformation at once, it is more convenient to use the individual transformation function and list them in order, like this: Example 2D Transform Functions The following table provides a brief overview of all the 2D transformation functions. Function Description translate(tx,ty) Moves the element by the given amount along the X and Y-axis. translateX(tx) Moves the the element by the given amount along the X-axis. translateY(ty) Moves the the element by the given amount along the Y-axis. rotate(a) Rotates the element by the specified angle around the origin of the element, as defined by the transform-origin property. scale(sx,sy) Scale the width and height of the element up or down by the given amount. The function scale(1,1) has no effect. scaleX(sx) Scale the width of the element up or down by the given amount. scaleY(sy) Scale the height of the element up or down by the given amount. skew(ax,ay) Skews the element by the given angle along the X and Y-axis. skewX(ax) Skews the element by the given angle along the X-axis. skewY(ay) Skews the element by the given angle along the Y-axis. matrix(n,n,n,n,n,n) Specifies a 2D transformation in the form of a transformation matrix comprised of the six values.
CSS3 Drop Shadows
Using CSS3 Drop Shadows The CSS3 gives you ability to add drop shadow effects to the elements like you do in Photoshop without using any images. Prior to CSS3, sliced images are used for creating the shadows around the elements that was quite annoying. The following section will describe you how to apply the shadow on text and elements. CSS3 box-shadow Property The box-shadow property can be used to add shadow to the element’s boxes. You can even apply more than one shadow effects using a comma-separated list of shadows. The basic syntax of creating a box shadow can be given with: box-shadow: offset-x offset-y blur-radius color; The components of the box-shadow property have the following meaning: See the CSS3 box-shadow property to learn more about the other possible values. Example Note: When adding the box-shadow, if the value for the blur-radius component is not specified, or set to zero (0), the edges of the shadow will be sharp. Similarly, you can add the multiple box shadow using a comma-separated list: Example CSS3 text-shadow Property You can use the text-shadow property to apply the shadow effects on text. You can also apply multiple shadows to text using the same notation as box-shadow. Example
CSS3 Text Overflow
Handling Text Overflow in CSS3 CSS3 introduced several new property properties for modifing the text contents, however some of these properties are existed from a long time. These properties give you precise control over the rendering of text on the web browser. Hiding Overflow Text Text can overflow, when it is prevented from wrapping, for example, if the value of white-space property is set to nowrap for the containing element or a single word is too long to fit like a long email address. In such situation you can use the CSS3 text-overflow property to determine how the overflowed text content will be displayed. You can either display or clip the overflowed text or clip and display an ellipsis or a custom string in palace of the clipped text to indicate the user. Values Accepted by the word-break property are: clip and ellipsis and string. Example Warning: The string value for the text-overflow property is not supported in most of the web browsers, you should better avoid this. Breaking Overflow Text You can also break a long word and force it to wrap onto a new line that overflows the boundaries of containing element using the CSS3 word-wrap property. Values Accepted by the word-wrap property are: normal and break-word. Example Tip: Please check out the individual property reference for all the possible values and the Browser support for these CSS properties. Specify Word Breaking Rules You can also specify the line breaking rules for the text (i.e. how to break lines within words) yourself using the CSS3 word-break property. Values Accepted by the word-break property are: normal, break-all and keep-all. Example