GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — GitHub - ariful19/Custom-Grid-WebComponent: Custom Web Components

BranchesTags
Open more actions menu

Latest commit

 

History

30 Commits
30 Commits

Folders and files

NameName
Last commit message
Last commit date
components
components
 
 
README.md
README.md
 
 
cnewsdemo.html
cnewsdemo.html
 
 
griddemo.html
griddemo.html
 
 
index.html
index.html
 
 
polyfill.js
polyfill.js
 
 
preview1.PNG
preview1.PNG
 
 
rotatingContentdemo.html
rotatingContentdemo.html
 
 

Repository files navigation

Custom Grid WebComponent

A simple grid web-component implements CSS3 grid system from behind.

    <c-grid cols-def='5' style="height: 400px;width: 400px">
        <div cols='1 / 2' rows='1 / 2' style="background-color: rgba(255, 0, 0, 0.253);"> div1</div>
        <div cols='2 / 5' rows='2 / 4' style="background-color: rgba(128, 128, 128, 0.267);height:5em;z-index: 1;">div2</div>
        <div cols='1 / 6' rows='2 / 5' style="background-color: rgba(255, 255, 0, 0.384);">div3</div>
        <div cols='2 / 6' rows='1 / 4' style="background-color: rgba(0, 183, 255, 0.384);">
            <c-grid cols-def='3' style="height: 100%;width: 100%">
                <div cols='1' rows='1' style="background-color: red">inner 1</div>
                <div cols='2' rows='2' style="background-color: green">inner 3</div>
                <div cols='3' rows='3' style="background-color: blue">inner 2</div>
            </c-grid>
        </div>
        <div cols='3 / 6' rows='4 / 4' style="background-color: rgba(0, 255, 64, 0.384);">div5</div>
    </c-grid>
    <script src="grid.js"></script>

This html should produce

alt text

Just defin a grid with column count in cols-def='<number>'

        <c-grid cols-def='5'>
        ...
        </c-grid>

Define location of immidiate child using cols and rows attributes. cols='1 / 4' rows='1 / 2' means that it starts from first column and continues untile fourth column. It starts from first row and ends in second row.

We don't need to define rows first. Rows will be added automatically.

About

Custom Web Components

Topics

css3-gridcustom-elementscustom-gridgrid-layoutjavascriptwebcomponents

Resources

Readme
Activity

Stars

1 star

Watchers

0 watching

Forks

0 forks
Report repository

Releases

Packages

Contributors

Languages

You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.