Web logo CSS

You're excited about HTML5; we are too. You've not just been enjoying the HTML5-powered web already — you're building it! As adoption and inspiration spreads, the web community will find creative ways to apply HTML5 and related technologies, spark trends, and capture best practices. As momentum builds, we hope you bring this logo along for the ride and paint the world orange.

A LOGO IN ACTION

You know that HTML5 badge you've placed oh-so perfectly in your footer? That HTML5 T-shirt turning heads in the office? Those HTML5 stickers on your laptop and that HTML5 logo you shaved into your head? We want to see it! Show us your screenshots, photos, and other creative endeavors and they might end up right here in our HTML5ivers Gallery.

On a website for your small business, your logo highlights your brand and identity to visitors. Your logo needs to be positioned prominently and on top of other content. Cascading style sheets allows precise, broad control of how your website content is displayed to users. Using CSS you can easily position your logo in a few lines of code.

  1. 1.

    Define your logo in a page division based on the following code.

    <div id="my_logo"> <img src="my_website_logo.png" id="my_logo_image"> </div>

  2. 2.

    Create a section for your CSS style sheet in the header of your HTML page.

    <style type="text/css">

    </style>

  3. 3.

    Link to an external CSS style sheet as an alternative for larger stylesheets. This code should also be placed in the header of your HTML page.

    <link rel="stylesheet" src="my_stylesheet.css">

  4. 4.

    Create a section in your CSS style sheet to modify the attributes of the logo "div." The "#" selector is used to select an object by ID.

    div#my_logo{ //CSS goes here }

  5. 5.

    Set the "position" attribute of "div#my_logo" to "absolute." This defines the position of the "div" to be absolute with respect to the page, being placed independently of other elements in the document-object model.

    div#my_logo{ position: absolute; }

  6. 6.

    Set the "top" and "left" attribues to be equal to the position you wish to place your logo. This can be defined in pixels, points and other measurements.

    div#my_logo{ position: absolute; top: 12pt; left: 24pt; }

  7. 7.

    Set the "z-index" attribute to a high number, greater than the "z-index" of other page elements. The absolute number is irrelevant; page elements are positioned according to the relative value of the "z-index."

    Step 1: To create the GFG logo, first we take two divs (which are inline) and make circles with them. But the div elements are block-level that’s why we wrap both the divs with a wrapper div and make that div (wrapper) to display flex. Apply border with 10px solid colored green. You will get something like this.

    Step 2: Now create a triangle on both the circles using pseudo-element: “after” and absolute position property. After applying the triangle we will get the shape like this.

    Here the triangle’s background-colors are yellow, this is just for explanation. Change the background-color of triangles into white.

    After applying the white background color into the triangles the result is :

    Step 3: Now using the pseudo-element :before and position absolute property, create a square. You can apply this rule to any of the circles. The resulting logo looks like this:

    Implementation with code :

    Step 1: Create two divs having classes named circle1 and circle2, and wrap them into a parent div having the class named wrapper.

    HTML




    <div class="wrapper">

      <div class=<2<3div>

      <div class=div1<3div>

    div5div>

    Now assign the CSS property to the wrapper class.

    .wrapper{
       display: flex;
    }

    And style both the circles 

    CSS




    div8div9class0

    class1class2class3class4class5

    class1class7class3class4class5

    class1=2class3=4 =5 =6class5

    class1=9class4class5

    class1"wrapper"3class3"wrapper"5class5

    "wrapper"7

    "wrapper"

    div8>0class0

    class1class2class3class4class5

    class1class7class3class4class5

    class1=2class3=4 =5 =6class5

    class1=9<1class5

    class1"wrapper"3class3"wrapper"5class5

    "wrapper"7

    Till now our logo looks like this

    Web logo CSS

    Step 2: Add the invisible triangles into both the circles using pseudo-element :after

    CSS




    div8div0div1

    class1div3class3div5class5

    class1"wrapper"3class3<00class5

    class1<03class3class4 =5 <07class5

    class1<10class3<12 =5 <14class5

    class1<17class3<19class5

    class1<22class3<24class5

    "wrapper"7

    "wrapper"

    div8<29div1

    class1div3class3div5class5

    class1"wrapper"3class3<00class5

    class1<03class3class4 =5 <07class5

    class1<49class3<12 =5 <14class5

    class1<56class3<19class5

    class1<22class3<24class5

    "wrapper"7

    The resulting logo looks like this –

    Web logo CSS

    Step 3: Now add square onto the logo using before pseudo-element (we are not using after (pseudo-element) because we already used it for creating triangle).

    CSS




    div8div0<68

    class1div3class3div5class5

    class1class2class3=4class5

    class1class7class3<82class5

    class1"wrapper"3class3<00class5

    class1<90class3=6class5

    class1<17class3<97class5

    class1<22class3div02class5

    class1div05class3div9class5

    "wrapper"7

    The resulting logo is:

    Web logo CSS

    Complete code :

    HTML




    div10

    <div12>

    div14 

    <div16>

    class1<div20>

    div22div23

    div24div25

    div22"wrapper"7

    div14 

    div22div30

    div24div32

    div24div34

    div24div36

    div24div38

    div24div40

    div22"wrapper"7

    div14 

    div22div45

    div24div32

    div24div34

    div24div36

    div24div53

    div24div40

    div22"wrapper"7

    div14 

    div22div60

    div24div62

    div24div64

    div24div66

    div24div68

    div24div70

    div24div72

    div22"wrapper"7

    div14 

    div22div77

    div24div62

    div24div64

    div24div66

    div24div85

    div24div87

    div24div72

    div22"wrapper"7

    div14 

    div22div94

    div24div62

    div24div98

    div24class00

    div24div64

    div24class04

    div24class06

    div24class08

    div24class10

    div22"wrapper"7

    class1div5div20>

    div5div16>

    div14 

    <class22>

    class1<div class="wrapper">

    div22<div =68==70 class=div1<3div>

    How to put a logo in CSS?

    We link the CSS file to our HTML document with a <link> tag or can place the CSS contents directly in HTML file using <style>tag. Inside the div tag, insert the logo using the <img> tag, so now our logo appears inside our loader class.

    How to set logo in HTML CSS?

    6 Simple Steps to Insert an Image or a Logo in HTML.
    Upload the Image File. For this step, we will be uploading an image file into a WordPress website's public_html directory via Hostinger's file manager. ... .
    Access the Theme Folder. ... .
    Add the img src Attribute to the Image. ... .
    Set Width and Height. ... .
    Add an Alt Attribute. ... .
    Save Changes..

    Can I design a logo with CSS?

    In order to create a CSS logo, you are going to need to be well versed in CSS positioning and comfortable using CSS3 properties like border-radius and transforms. And if you want to get fancy with your CSS logo, you can give gradients and box-shadows a try!

    How do I add a logo to my website using HTML?

    How to Insert an Image in HTML in 6 Easy Steps.
    Upload the Image File..
    Access the Theme Folder..
    Add the img src Attribute to the Image..
    Set Width and Height..
    Add an Alt Attribute..
    Save Changes..