About 15,500,000 results
Open links in new tab
  1. How To Create Different Shapes with CSS - W3Schools

    Learn how to create different shapes with CSS. Track your progress - it's free! Well organized and easy to understand Web building tutorials with lots of examples of how to use HTML, CSS, JavaScript, SQL, Python, PHP, Bootstrap, Java, XML and more.

  2. how to draw a rectangle in HTML or CSS? - Stack Overflow

    I am trying to draw a rectangle and I found the website for css code(http://css-tricks.com/examples/ShapesOfCSS/). How do I put together in HTML? In other words, how do I define #rectangle in HTML. Facebook always has blue rectangle at the top of each page. What is the best way to achieve like them? I appreciate if someone could help me.

  3. Four Simple Ways to Draw a Rectangle in HTMLSitePoint

    Mar 8, 2023 · How Can I Draw a Rectangle Using CSS? CSS can be used to create a rectangle by specifying the width and height of an HTML element. Here’s a simple example: <div...

  4. html - Drawing rectangles with CSS - Stack Overflow

    Nov 16, 2013 · The simplest way is to use a negative margin-bottom to achieve this (you don't need to use positioning): CSS:.hanging { margin-bottom: -16px; height:4em; } JSFiddle. Note: also comment the whitespace between display:inline-block elements to remove it.

  5. The Shapes of CSS - CSS-Tricks

    Oct 1, 2018 · Squares and rectangles are easy, as they are the natural shapes of the web. Add a width and height and you have the exact size rectangle you need. Add border-radius and you can round that shape, and enough of it you can turn those rectangles into circles and ovals.

  6. Creating a Rectangle with just CSS | CSSBattle Blog

    Dec 30, 2024 · Continuing with our series on creating shapes with CSS, this blog post will take you through different approaches to create a Rectangle using CSS! 1. Width & Height: The Classic Approach # The most straightforward way to create a rectangle is by setting width and height properties on a block element (eg. <div>)..element {width: 200px; height ...

  7. HTML Canvas Rectangles - W3Schools

    Use rect() to define a 150*100 pixels rectangle, starting in position (10,10). Then use stroke() to actually draw the rectangle: Sorry, your browser does not support canvas.

  8. How to create rectangle in html/css? - Stack Overflow

    Jan 3, 2018 · Text with borders, but one side of the border has another text. Where's your code? What have you tried? You can use border on the main container but hide the bottom one. Then use pseudo element to complete the missing border: text-align:center; background:linear-gradient(to right, yellow, white); display: inline-block; font-size: 28px;

  9. How to Create a Rectangular Box to Contain Your Text/Pictures with CSS

    Apr 7, 2020 · Being able to draw a line around a block of text and/or pictures is handy if you want to group a section of related items together. This has the visual effect of placing your text and pictures in a rectangular box.

  10. Shapes in CSS - Alvaro Montoro

    Oct 8, 2023 · So, a rectangle is simple to draw; specify a width and a height. If that doesn't work, you may use an element with an inline display, switch to a block or inline-block element, and you should be fine. A square is a rectangle where the width and the height have the same value.

  11. Some results have been removed
Refresh