Search
 
SCRIPT & CODE EXAMPLE
 

CSS

how to create a square element with css with dynamic width

<div class="square">
  <div class="content">
    Hello!
  </div>
</div>

.square {
  position: relative;
  width: 50%;
}

.square:after {
  content: "";
  display: block;
  padding-bottom: 100%;
}

.content {
  position: absolute;
  width: 100%;
  height: 100%;
}
Comment

PREVIOUS NEXT
Code Example
Css :: free hrml css curs 
Css :: what does color dodge do 
Css :: bast css 3d images gallery code 
Css :: More examples and patterns in scrapy 
Css :: flex 
Css :: which port does ssh use 
Css :: creating a static flex container with scrolling child element 
Css :: css loading spinner with text 
Css :: adding a background image in css 
Css :: Create 2 separate CSS rules for the code below: 
Css :: parcel-bundler bulma css 
Css :: on hover show text in bootstrap 
Css :: details summary not open css 
Css :: Pass argument to group_by 
Css :: multiple nth child css 
Css :: edit default theme in component angular css 
Css :: ul hide bullet css 
Css :: center content in div 
Css :: how to fix the html on tablet movement 
Css :: css transition only once 
Css :: navbar for front-end 
Css :: id selector 
Css :: tslib.es6 
Css :: spinner 
Css :: import font woff css 
Css :: background behind image css 
Typescript :: remove dots from ul li 
Typescript :: typescript record optional 
Typescript :: python tkinter clear frame 
Typescript :: how to navigate from one page to another in angular 
ADD CONTENT
Topic
Content
Source link
Name
7+8 =