One place for hosting & domains

      Change

      How to Change a CSS Background Image’s Opacity


      While this tutorial has content that we believe is of great benefit to our community, we have not yet tested or
      edited it to ensure you have an error-free learning experience. It’s on our list, and we’re working on it!
      You can help us out by using the “report an issue” button at the bottom of the tutorial.

      With CSS and CSS3 you can do a lot of things, but setting an opacity on a CSS background is not one of them. However, if you get creative, there are a ton of creative work-arounds you to make it seem like you’re changing the CSS background image’s opacity. Both of the following methods have excellent browser support down to Internet Explorer 8.

      Method 1: Use absolute positioning and an image

      This method is exactly like it sounds. You simply use absolute positioning on an a normal img tag and make it seem like you used the CSS background-image property. All you have to do is put the image inside of a position: relative; container. Here’s what the HTML markup generally looks like:

      <div class="demo_wrap">
        <h1>Hello World!</h1>
        <img src="https://www.xpresservers.com/wp-content/uploads/2020/09/How-to-Change-a-CSS-Background-Images-Opacity.png">
      </div>
      

      And here’s what your CSS will look like:

      .demo_wrap {
          position: relative;
          overflow: hidden;
          padding: 16px;
          border: 1px dashed green;
      }
      .demo_wrap h1 {
          padding: 100px;
          position: relative;
          z-index: 2;
      }
      .demo_wrap img {
          position: absolute;
          left: 0;
          top: 0;
          width: 100%;
          height: auto;
          opacity: 0.6;
      }
      

      The trick here is to absolutely position the img and stretch it so it fills the entire parent container. And to relatively position everything else so that you can set a z-index that pulls it above the img.

      Here’s a live demo:

      Method 2: Using CSS Pseudo-Elements

      This method is seems simple once you see it, and is definitely my preferred method of doing this. Using CSS pseudo-elements of either :before or :after, you a div with a background image and set an opacity on it. Here’s what your HTML markup would roughly look like:

      <div class="demo_wrap">
        <h1>Hello World!</h1>
      </div>
      

      And here’s what the CSS looks like:

         .demo_wrap {
          position: relative;
          background: #5C97FF;
          overflow: hidden;
      }
      .demo_wrap h1 {
          padding: 50px;
          position: relative;
          z-index: 2;
      }
      /* You could use :after - it doesn't really matter */
      .demo_wrap:before {
          content: ' ';
          display: block;
          position: absolute;
          left: 0;
          top: 0;
          width: 100%;
          height: 100%;
          z-index: 1;
          opacity: 0.6;
          background-image: url('https://www.xpresservers.com/wp-content/uploads/2020/09/How-to-Change-a-CSS-Background-Images-Opacity.png');
          background-repeat: no-repeat;
          background-position: 50% 0;
          background-size: cover;
      }
      

      Here again we must move the z-index of content (in this cas the <h1>) above the background pseudoelement, and we must explicitly define the position: absolute; and z-index: 1 on the :before pseudoelement.

      The rest of the attributes on the pseudoelement exist to position it to overlap 100% of the parent, and also make use of a clever new CSS property: background-size: cover which sizes the background to cover the element without changing proportions.
      Here’s a nice little demo of this method:



      Source link

      Change the Mouse Cursor in CSS With the cursor Property


      While this tutorial has content that we believe is of great benefit to our community, we have not yet tested or
      edited it to ensure you have an error-free learning experience. It’s on our list, and we’re working on it!
      You can help us out by using the “report an issue” button at the bottom of the tutorial.

      cursor is used to change the mouse cursor on specific elements. This is especially useful in web apps where different tasks can be done other than clicking. This obviously only works when there’s a pointing device:

      .in-progress {
        cursor: progress;
      }
      

      Available Cursors

      Hover over the following to see the different cursors available if you’re on a desktop/laptop computer:

      General/Default Cursors

      Scroll Cursor

      Status Cursors

      context-menu

      help

      wait

      progress

      Selection Cursors

      crosshair

      cell

      text

      vertical-text

      Drag & Drop Cursors

      alias

      copy

      move

      no-drop

      not-allowed

      Zoom Cursors

      Grab Cursors

      Resizing Cursors

      e-resize

      n-resize

      ne-resize

      nw-resize

      s-resize

      se-resize

      sw-resize

      w-resize

      ew-resize

      ns-resize

      nesw-resize

      nwse-resize

      col-resize

      row-resize

      Custom Cursors

      You can define custom cursors. Note that not all browsers support svg files for cursors, and .cur files are supported across the board, so it can be a good idea to provide a .cur fallback if you want to use an svg cursor. You can also provide a fallback to one of the non-custom cursors.

      You can define a custom position for the cursor hotspot by adding x & y coordinates for where the hotspot should be in the provided custom image.

      Note that, when using svg cursors, it’s important that your svg has width & height values on the root svg element, or else your cursor won’t show. In the following example, our svg file (droplet.svg) starts like this:

      <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 42 42" width="42" height="42">...
      
      .custom-cur {
        cursor: url('/images/droplet.svg');
      }
      
      /* With a .cur fallback */
      .custom-cur {
        cursor: url('/images/droplet.svg'),
        url('/images/droplet.cur');
      }
      
      /* With a custom hotspot */
      .custom-cur {
        cursor: url('/images/droplet.svg') 10 12;
      }
      
      /* With a non-custom fallback: */
      .custom-cur {
        cursor: url('/images/droplet.svg'),
        move;
      }
      

      Here’s an example with a custom cursor:

      Dino Sammy Cursor

      Browser Support:
      As of 2020, only 80% of browsers worldwide support custom cursors according to Can I Use css3-cursors?. But this isn’t surprising, many of the browsers that don’t support it are mobile-only browsers that have no use for cursors.

      Conclusion:

      Custom cursors are most commonly used to indicate that an HTML element that’s not already a link <a href="https://www.digitalocean.com/community/tutorials/..."> is clickable. But it provides a diverse set of additional configurability that could be useful to developers building rich web apps. Keep the following caveats in mind when using custom cursors:

      1. Your users spend most of their time on other sites, so use custom cursors in a way that is consistent with other sites.
      2. Touchscreen users (mobile and tablet) won’t see custom cursors.



      Source link

      How to Change Your Email Address


      Updated by Linode

      Written by Linode

      Changing your account’s email address is easy and can be done two different ways.

      From the Cloud Manager

      1. Log in to the Cloud Manager.

      2. Click on your username and choose My Profile from the drop down menu.

        Click My Profile from Username Drop Down Menu

      3. On the My Profile page, in the Email field, enter the email you would like to associate with your account.

      4. Click the Save button.

        Click to Save a New Email

      5. Cloud Manager will tell you that the email address has been updated. You will also receive an email at this new address from Linode Support confirming this update.

      6. If you enter an invalid email address, the following error message is displayed.

        Error Message for Invalid Email

      Using the API

      You can also use the Linode API to view and update your account’s email address.

      1. Use the View Account endpoint to view your account information including your email address:

        curl -H "Authorization: Bearer $TOKEN" 
        https://api.linode.com/v4/account
        
      2. An example of the output:

          
        {
          "active_promotions": [
            {
              "credit_monthly_cap": "10.00",
              "credit_remaining": "50.00",
              "description": "Receive up to $10 off your services every month for 6 months! Unused credits will expire once this promotion period ends.",
              "expire_dt": "2018-01-31T23:59:59",
              "image_url": "https://linode.com/10_a_month_promotion.svg",
              "summary": "$10 off your Linode a month!",
              "this_month_credit_remaining": "10.00"
            }
          ],
          "active_since": "2018-01-01T00:01:01",
          "address_1": "123 Main Street",
          "address_2": "Suite A",
          "balance": 200,
          "balance_uninvoiced": 145,
          "capabilities": [],
          "city": "Philadelphia",
          "credit_card": {
            "last_four": 1111,
            "expiry": "11/2022"
          },
          "company": "Linode LLC",
          "country": "US",
          "email": "[email protected]",
          "first_name": "John",
          "last_name": "Smith",
          "phone": "215-555-1212",
          "state": "Pennsylvania",
          "tax_id": "ATU99999999",
          "euuid": "E1AF5EEC-526F-487D-B317EBEB34C87D71",
          "zip": 19102
        }
        
        
      3. To update your email address, use the Update Account endpoint:

        curl -H "Content-Type: application/json" 
        -H "Authorization: Bearer $TOKEN" 
        -X PUT -d '{
        "email": "[email protected]"
        }
        }' 
        https://api.linode.com/v4/account
        
      4. The output will be mostly the same, but this time, the email field will be updated with your new email address:

          
        {
          "active_promotions": [
            {
              "credit_monthly_cap": "10.00",
              "credit_remaining": "50.00",
              "description": "Receive up to $10 off your services every month for 6 months! Unused credits will expire once this promotion period ends.",
              "expire_dt": "2018-01-31T23:59:59",
              "image_url": "https://linode.com/10_a_month_promotion.svg",
              "summary": "$10 off your Linode a month!",
              "this_month_credit_remaining": "10.00"
            }
          ],
          "active_since": "2018-01-01T00:01:01",
          "address_1": "123 Main Street",
          "address_2": "Suite A",
          "balance": 200,
          "balance_uninvoiced": 145,
          "capabilities": [],
          "city": "Philadelphia",
          "credit_card": {
            "last_four": 1111,
            "expiry": "11/2022"
          },
          "company": "Linode LLC",
          "country": "US",
          "email": "[email protected]",
          "first_name": "John",
          "last_name": "Smith",
          "phone": "215-555-1212",
          "state": "Pennsylvania",
          "tax_id": "ATU99999999",
          "euuid": "E1AF5EEC-526F-487D-B317EBEB34C87D71",
          "zip": 19102
        }
        
        

      This guide is published under a CC BY-ND 4.0 license.



      Source link