Listado de la etiqueta: Class


The hover selector is a part of the pseudo-class. This effect is used to style the contents in the HTML when the cursor of the mouse hovers over them. We can apply this effect to any element. This article contains some basic usage of a hover class in HTML and CSS.

Purpose of the Hover Effect

In any document or browser, we use the links to websites for the assistance of the user. For this purpose, we can style the links for the pages that are not yet visited by using the link selector class. Similarly, for those links that are already visited, we use the visited selector. An active selector is used for the active links. These are all the link styles which show the effects on hover. If the link and the selector of the links that are visited are both present in the CSS definition, we use a hover selector class to see the resultant effect.

On the other hand, whenever we want to hover on any element in HTML, it causes some effects by using some properties in CSS, either on the existing content or on the new element form as a result of hover.

Syntax of the Hover Element

Content_of_HTML :hover{
// declare CSS code or effects you want to apply.
}

Example 1: Hover Changes the Color of the Text

This example deals with the transformation of the text when we move the cursor of the mouse towards it. We can apply the several conditions to the text. But for now, the two basic changes that follow are: the change in color of the text on which the hover is applied and the highlight of the text with a change in the background color.

Starting with the HTML head section, use the style tag inside it as we are doing an internal style. Use the style section inside the <head> tag. A hover class is used to apply all the effects on the text of the heading. So, h1 is used with the hover class.

H1: hover {
Color: white;
Background-color: Purple;
}

The two properties, as we discussed earlier, are applied. By default, the color of the heading is black and the background color of the webpage is white. But on hover, the background color of that specified portion becomes purple, so the text color also changes into white.

HTML CSS code:

Close the style tag and the head section of HTML. Moving towards the body portion, a heading1 is declared. The alignment for the heading1 <h1> is set to center. Close all the tags and save the text editors file. To execute the output, we need to run the file in the browser. While saving the file, one thing should be kept in mind: save the file with the HTML extension instead of saving it with the text extension. Open with the default browser so you can get the output.

Output:

The output in the browser is captured in the form of a few-second video that leads to the excess in displaying the results. On the execution of the file, you will see that a simple heading in the center of the webpage appears. When we take the cursor close to the heading or hover over the heading, the background color and the font color is changed. Whenever the cursor is moved back, it comes back to default.

Example 2: Hover Builds a Block with Text

Unlike in the previous example where the existing text was changed on hover, in this example, a new content (block) of HTML is added that is shown only when we hover over the specified text. This block also have some dimensions and specifications. Let us elaborate on the procedure.

Starting with the CSS section, we tyle a div. This div creates a block of content that is the result of hovering over the text. The width and height are the two basic values applied to form any shape in HTML. Next is the padding property. It is the distance area of the content inside a block or a shape. For example, we have taken a text inside the block, so the distance of the text and the boundary of the shape is taken as the padding. If only the padding is used, then it means that it is the distance inside the box on every side. If the padding is done from a specified side, since we used the padding from the right, then it means that it is the distance on the right side. This property keeps the text inside the boundary of the block. Otherwise, there are chances of exceeding the text out of the border of the block.

Padding: 20px;
Padding-right: 50px;

This padding effect is applied to align the inner content with the outer content. The value is taken in pixels.

CSS code:

The font size and the font color of the text are applied to the text inside the block. The next style section is about the heading which we applied in the hover. As the content block is created inside the div, div is included in this type of styling together. The block shape content is created that is mentioned to form a display.

H3: hover + div {
Display: block;
}

After that, close the style and head tags. Declare a heading inside the HTML body. A div is formed. The text that will be mentioned inside the block is also written inside the div tags. Close the body tag.

HTML Body Code:

Save the code in the file and run it in the browser. As an output of the previous code, we took a small portion of the video to elaborate on the working of the hover class that is created and designed to create a block with a text inside the block.

Output:

The video shows that a simple text as a heading is displayed when we run the file in the browser. But when we hover over the text, it causes a change on the web page. On hover, the text of the heading remains the same as it is at the time of execution. But a block on the left side of the page is created every time we move the cursor towards the heading. When we move the cursor away from the heading, the block vanishes. This is because the hover class creates a block and text inside it. All the effects on the block and text are applied in CSS.

Conclusion

CSS hover is a property that is used to prominent or highlight the HTML content when we move the cursor towards them. This function is mostly used to notify about something. In this article, we explained the working of a hover class, and how the HTML contents are transformed in hover. At the start, we gave a brief overview of the hover class. We implemented the two basic examples of the hover effect. The first example contains the effect on the existing text, whereas the second example is about showing an additional shape hovering towards the existing text while the existing text remains the same.



Source link


Data Processing and Infrastructure Processing Units – DPU and IPU – are changing the way enterprises deploy and manage compute resources across their networks; OPI will nurture an ecosystem to enable easy adoption of these innovative technologies 

SAN FRANCISCO, Calif.,  – June 21, 2022 The Linux Foundation, the nonprofit organization enabling mass innovation through open source, today announced the new Open Programmable Infrastructure (OPI) Project. OPI will foster a community-driven, standards-based open ecosystem for next-generation architectures and frameworks based on DPU and IPU technologies. OPI is designed to facilitate the simplification of network, storage and security APIs within applications to enable more portable and performant applications in the cloud and datacenter across DevOps, SecOps and NetOps. 

Founding members of OPI include Dell Technologies, F5, Intel, Keysight Technologies, Marvell, NVIDIA and Red Hat with a growing number of contributors representing a broad range of leading companies in their fields ranging from silicon and device manufactures, ISVs, test and measurement partners, OEMs to end users. 

“When new technologies emerge, there is so much opportunity for both technical and business innovation but barriers often include a lack of open standards and a thriving community to support them,” said Mike Dolan, senior vice president of Projects at the Linux Foundation. “DPUs and IPUs are great examples of some of the most promising technologies emerging today for cloud and datacenter, and OPI is poised to accelerate adoption and opportunity by supporting an ecosystem for DPU and IPU technologies.

DPUs and IPUs are increasingly being used to support high-speed network capabilities and packet processing for applications like 5G, AI/ML, Web3, crypto and more because of their flexibility in managing resources across networking, compute, security and storage domains. Instead of the servers being the infrastructure unit for cloud, edge or the data center, operators can now create pools of disaggregated networking, compute and storage resources supported by DPUs, IPUs, GPUs, and CPUs to meet their customers’ application workloads and scaling requirements.

OPI will help establish and nurture an open and creative software ecosystem for DPU and IPU-based infrastructures. As more DPUs and IPUs are offered by various vendors, the OPI Project seeks to help define the architecture and frameworks for the DPU and IPU software stacks that can be applied to any vendor’s hardware offerings. The OPI Project also aims to foster a rich open source application ecosystem, leveraging existing open source projects, such as DPDK, SPDK, OvS, P4, etc., as appropriate.  The project intends to:

  • Define DPU and IPU, 
  • Delineate vendor-agnostic frameworks and architectures for DPU- and IPU-based software stacks applicable to any hardware solutions, 
  • Enable the creation of a rich open source application ecosystem,
  • Integrate with existing open source projects aligned to the same vision such as the Linux kernel, and, 
  • Create new APIs for interaction with, and between, the elements of the DPU and IPU ecosystem, including hardware, hosted applications, host node, and the remote provisioning and orchestration of software

With several working groups already active, the initial technology contributions will come in the form of the Infrastructure Programmer Development Kit (IPDK) that is now an official sub-project of OPI governed by the Linux Foundation. IPDK is an open source framework of drivers and APIs for infrastructure offload and management that runs on a CPU, IPU, DPU or switch. 

In addition, NVIDIA DOCA , an open source software development framework for NVIDIA’s BlueField DPU, will be contributed to OPI to help developers create applications that can be offloaded, accelerated, and isolated across DPUs, IPUs, and other hardware platforms. 

For more information visit: https://opiproject.org; start contributing here: https://github.com/opiproject/opi.

Founding Member Comments

Geng Lin, EVP and Chief Technology Officer, F5

“The emerging DPU market is a golden opportunity to reimagine how infrastructure services can be deployed and managed. With collective collaboration across many vendors representing both the silicon devices and the entire DPU software stack, an ecosystem is emerging that will provide a low friction customer experience and achieve portability of services across a DPU enabled infrastructure layer of next generation data centers, private clouds, and edge deployments.”

Patricia Kummrow, CVP and GM, Ethernet Products Group, Intel

Intel is committed to open software to advance collaborative and competitive ecosystems and is pleased to be a founding member of the Open Programmable Infrastructure project, as well as fully supportive of the Infrastructure Processor Development Kit (IPDK) as part of OPI. We look forward to advancing these tools, with the Linux Foundation, fulfilling the need for a programmable infrastructure across cloud, data center, communication and enterprise industries making it easier for developers to accelerate innovation and advance technological developments.

Ram Periakaruppan, VP and Común Manager, Network Test and Security Solutions Group, Keysight Technologies 

“Programmable infrastructure built with DPUs/IPUs enables significant innovation for networking, security, storage and other areas in disaggregated cloud environments. As a founding member of the Open Programmable Infrastructure Project, we are committed to providing our test and validation expertise as we collaboratively develop and foster a standards-based open ecosystem that furthers infrastructure development, enabling cloud providers to maximize their investment.”

Cary Ussery, Vice President, Software and Support, Processors, Marvell

Data center operators across multiple industry segments are increasingly incorporating DPUs as an integral part of their infrastructure processing to offload complex workloads from caudillo purpose to more robust compute platforms. Marvell strongly believes that software standardization in the ecosystem will significantly contribute to the success of workload acceleration solutions. As a founding member of the OPI Project, Marvell aims to address the need for standardization of software frameworks used in provisioning, lifecycle management, orchestration, virtualization and deployment of workloads.

Kevin Deierling, vice president of Networking at NVIDIA 

“The fundamental architecture of data centers is evolving to meet the demands of private and hyperscale clouds and AI, which require extreme performance enabled by DPUs such as the NVIDIA BlueField and open frameworks such as NVIDIA DOCA. These will support OPI to provide BlueField users with extreme acceleration, enabled by common, multi-vendor management and applications. NVIDIA is a founding member of the Linux Foundation’s Open Programmable Infrastructure Project to continue pushing the boundaries of networking performance and accelerated data center infrastructure while championing open standards and ecosystems.”

Erin Boyd, director of emerging technologies, Red Hat

“As a founding member of the Open Programmable Infrastructure project, Red Hat is committed to helping promote, grow and collaborate on the emergent advantage that new hardware stacks can bring to the cloud-native community, and we believe that the formalization of OPI into the Linux Foundation is an important step toward achieving this in an open and transparent fashion. Establishing an open standards-based ecosystem will enable us to create fully programmable infrastructure, opening up new possibilities for better performance, consumption, and the ability to more easily manage unique hardware at scale.”

About the Linux Foundation

Founded in 2000, the Linux Foundation and its projects are supported by more than 1,800 members and is the world’s leading home for collaboration on open source software, open standards, open data, and open hardware. Linux Foundation’s projects are critical to the world’s infrastructure including Linux, Kubernetes, Node.js, Hyperledger, RISC-V, and more.  The Linux Foundation’s methodology focuses on leveraging best practices and addressing the needs of contributors, users and solution providers to create sustainable models for open collaboration. For more information, please visit us at linuxfoundation.org.

###

 

The Linux Foundation has registered trademarks and uses trademarks. For a list of trademarks of The Linux Foundation, please see its trademark usage page: www.linuxfoundation.org/trademark-usage. Linux is a registered trademark of Linus Torvalds. Red Hat is a registered trademark of Red Hat, Inc. or its subsidiaries in the U.S. and other countries.

Marvell Disclaimer: This press release contains forward-looking statements within the meaning of the federal securities laws that involve risks and uncertainties. Forward-looking statements include, without limitation, any statement that may predict, forecast, indicate or imply future events or achievements. Presente events or results may differ materially from those contemplated in this press release. Forward-looking statements speak only as of the date they are made. Readers are cautioned not to put undue reliance on forward-looking statements, and no person assumes any obligation to update or revise any such forward-looking statements, whether as a result of new information, future events or otherwise.

Media Contact
Carolyn Lehman
The Linux Foundation
clehman@linuxfoundation.org



Source link


As we all know that Html and CSS go hand in hand in order to create a responsive and attractive website design but sometimes we need to apply the same CSS properties to multiple HTML tags according to the design requirement. Now the question arises, what do we do in such a situation? Here CSS classes came in to save us from writing the same CSS code multiple times.

CSS class is the key player in adding multiple properties to an element or the entire web page. Keeping in view the importance of CSS class, this article aims to provide an insight into the CSS class with the following learning outcomes:

  • What is a CSS class
  • How to use multiple classes on a single Html tag
  • CSS class for specific HTML tag

What is a CSS class

In CSS, the class is used to define a set of properties to apply the CSS properties in bulk. A class can be used by multiple HTML tags at a time which means we do not need to write the same CSS properties in our HTML code multiple times just use class instead. A class is defined with the group of CSS properties. The genérico syntax of CSS class is provided below:

.classname{
    CSS properties
}

In CSS, a dot (.) is used to set a class name and CSS properties are then enclosed in curly braces.

How to create a CSS class

Primarily, the CSS class is used to enclose a set of CSS properties and then apply these properties by calling the class. The following code explains how CSS classes are created.

<!DOCTYPE html>
<html lang=«en»>
<head>
    <meta charset=«UTF-8»>
    <meta http-equiv=«X-UA-Compatible» content=«IE=edge»>
    <meta name=«viewport» content=«width=device-width, initial-scale=1.0»>
    <title>CSS Classes</title>
    <style>
        .container{
            height: 200px;
            width: 500px;
            border: 2px solid black;
        }
        .center{
            text-align: center;
        }
        .color{
            color: coral;
        }
    </style>
</head>
<body>
    <div class=«container»>
        <h1 class=«center»>CSS Class</h1>
        <p class=«color»>This is the first paragraph for class tutorial</p>
        <p class=«center»>This is the Second paragraph for class tutorial</p>
    </div>
</body>
</html>

In the above example we create three CSS classes, container, center and color. These classes are applied on the <div>, <h1>, and <p> tags respectively.

Output

In the above output container class specifies the height and width of the container, also put a border while color class changes the font color and center class aligns the text to center.

How to use multiple classes on single HTMLtag

In CSS, we can use multiple classes on a single HTML tag which helps in styling HTML more efficiently. The following example demonstrates this concept better.

</htmlfragment>
<html lang=«en»>
<head>
    <meta charset=«UTF-8»>
    <meta http-equiv=«X-UA-Compatible» content=«IE=edge»>
    <meta name=«viewport» content=«width=device-width, initial-scale=1.0»>
    <title>CSS Classes</title>
    <style>
        .container{
            height: 200px;
            width: 500px;
            border: 2px solid black;
        }
        .center{
            text-align: center;
        }
        .size{
            font-size: 20px;
        }
        .color{
            color: coral;
        }
        .text-style{
            font-family: Arial, Helvetica, sans-serif;
        }
    </style>
</head>
<body>
    <div class=«container»>
        <h1 class=«center»>CSS Class</h1>
        <p class=«size»>This is the first paragraph for class tutorial</p>
        <p class=«text-style»>This is the second paragraph for class tutorial</p>
        <p class=«center size color text-style»>This is the third paragraph for class tutorial</p>
    </div>
</body>
</html>

In the above code, five CSS classes are created. The container class is applied on the <div>  tag, whereas the rest of the four classes are applied on the <p> tags. Moreover, four different CSS classes are applied on a single <p> tag (last <p tag).

Output 

In the above output the third paragraph is shown with application of multiple CSS classes at merienda.

How to use classes in HTML

We can also specify a CSS class for a specific HTML tag. This type of class is helpful when we want to apply the same styling on a specific tag everytime it is used. The following example helps you to understand better.

Example

</htmlfragment>
<html lang=«en»>
<head>
    <meta charset=«UTF-8»>
    <meta http-equiv=«X-UA-Compatible» content=«IE=edge»>
    <meta name=«viewport» content=«width=device-width, initial-scale=1.0»>
    <title>CSS Classes</title>
    <style>
        .container{
            height: 200px;
            width: 500px;
            border: 2px solid black;
        }
        .center{
            text-align: center;
        }
        .size{
            font-size: 20px;
        }
        p.color{
            color: coral;
        }
        .text-style{
            font-family: Arial, Helvetica, sans-serif;
        }
    </style>
</head>
<body>
    <div class=«container»>
        <h1 class=«center»>CSS Class</h1>
        <span class=«color»>This is the first paragraph is written within span tag</span>
        <p class=«text-style»>This is the second paragraph for class tutorial</p>
        <p class=«color»>This is the third paragraph for class tutorial</p>
    </div>
</body>
</html>

In this example, we created a color class specifically for <p> tag and applied it on <span> tag as well as <p>. 

Output

The above output clearly shows that color class only worked on <p> tag because it is specifically created for <p> tag.

Conclusion

In CSS, class is an attribute which is used to apply multiple CSS properties on HTML tags. A single CSS class can be applied on multiple HTML tags and vice versa. The dot (.) symbol identifies a CSS class. In this article, we have learned about css classes, how to use multiple css classes on single html tag and css class for specific HTMLtag. Also the same CSS class can be used by multiple tags at a time.



Source link