Snippets tagged “width”
18 snippets use this tag.
- How to Calculate the Width of an Element with the CSS calc() FunctionCSS
In this snippet, you’ll learn how to calculate the width of an element with the CSS calc() function. See examples, where we mix percentages and pixels.
- How to Center a Button Both Horizontally and Vertically within a DivCSS
In our snippet you can find some solutions to the problem of centering a button within a <div>. One of our solutions to the problem also includes using Flexbox.
- How to Control the Width of the <label> TagCSS
Since the <label> tag is an inline element, using the width property won’t have any effect. Here you can find some methods of adding width to the <label> tag.
- How to Create a Two-Column Div Layout with the Right Column Having Fixed WidthHTML
In this tutorial, we’ll explain how to create a two-column <div> layout with the right column having a fixed width. Here, you can find some examples.
- How to Create Two Inline-Block Columns With 50% WidthCSS
In this snippet, find out how to create two inline-block columns, both having 50% width and avoid wrapping. You need to use two CSS properties: display and width.
- How to Divide a Horizontal Line into Multiple PartsHTML
In this tutorial, you will learn how it is possible to divide an HTML horizontal line into multiple parts. For that, you can use the CSS border-top property.
- How to Get Image Size Using JavaScriptJavaScript
Read this tutorial and learn the two methods of getting the width and height of the image. Learn about the properties that help to get the image size.
- How to Horizontally Center a <div> in Another <div>CSS
The <div> tag is used to define parts of a page or a document. Learn How to Horizontally Center a <div> in Another <div> with W3docs tutorial.
- How To Make a <div> Element Extend to the Page Bottom Even Having No ContentCSS
In this snippet, we will show how to make a <div> element extend to the page bottom even when it has no content. Read the tutorial and find some examples.
- How to Make a Child Div Element Wider than the Parent DivCSS
On this page, we’ll demonstrate how you can make a child <div> element wider than the parent <div> element. See what CSS properties you need and try examples.
- How to Make a Div Fill the Remaining WidthHTML
In this snippet, we’re going to demonstrate some ways of making a <div> expand to fill the remaining width. You can use the float and overflow properties.
- How to Resize Images Proportionally for Responsive Web Design With CSSCSS
Learn how to resize images to have a responsive web design. Use HTML attributes or CSS width and height properties. See examples and practice the methods for yourself.
- How to Resize SVG in HTMLHTML
In this tutorial, we want to demonstrate how you can resize SVG image in HTML. For that, you can change the values of the “height” and “width” attributes.
- How to Set the Size of the <textarea> ElementHTML
In this tutorial, you will find two ways of setting the size of the HTML <textarea> element. For that purpose, you can use HTML attributes or CSS properties.
- How to Set the Size of the Background-imageCSS
Learn How to Set the Size of the Background-image. Use the background-size property. In this snippet, we’ll show you how to do that with examples.
- How to Set the Table Column Width Regardless of the Text Amount in its CellsHTML
Sometimes, when the text in one of the cells of the column is too long, the column’s width change. Read this snippet to find out how to overcome this problem.
- How to Set the Width of the Table ColumnCSS
In this tutorial, we’ll show how you can set the width of the HTML table column. For that purpose, you need to use some CSS, particularly the width property.
- What is the Difference Between the "inline" and "inline-block" Values of the CSS display PropertyCSS
In this snippet, you can see what is the difference between the inline and inline-block display in CSS. We’ll demonstrate an example to show their difference.