CSS – All

CSS – all ”; Previous Next The shorthand CSS property all resets all properties of an element, with the exception of unicode bidi, direction and CSS custom properties. It can reset properties to their original or inherited values or to the values explicitly defined in another cascade layer or in the stylesheet origin. Constituent Properties This property serves as a concise representation for all CSS properties, with the exception of unicode bidi, direction and CSS custom properties. The all property is specified with one of the global CSS keyword values. It is important to note that none of these values impact the unicode bidi and direction properties. Possible values The following is the list of possible values of all properties. initial – Indicates that all properties of the element should be reset to their initial values. inherit – Indicates that all properties of the element should be set to their inherited values. unset – Indicates that the element”s properties should set to inherited values in case of default inheritance, else to their initial values. revert – Specifies the behavior depending on the stylesheet origin associated with the declaration: If the rule is linked to the author”s origin, the revert value reverts the cascade to the user level and recalculates the specified values as if no author-level rules were applied to the element. In the context of revert, the author origin includes the override and animation origins. If the rule is part of the user origin, the value revert resets the cascade to the user agent level. This means that the specified values are calculated as if no rules were defined at author or user level for the element. If the rule originates from the user agent origin, the value revert behaves similarly to unset. revert-layer – Specifies the rollback of all properties of the element to a previous cascade layer, if available. This is still in experimental phase. If no other cascade layer is available, the properties of the element are reset to the matching rule in the current layer, if available, or to an earlier style origin. Syntax all = initial | inherit | unset | revert | revert-layer CSS all – Basic Example In the following example, the CSS all property is used to completely adjust all styling properties within specific elements. The first <div> with id=custom1 showcases the default styling without the all property, while subsequent <div> elements (custom2, custom3, and custom4) demonstrate the impact of all: inherit;, all: initial;, and all: unset; respectively. <html> <head> <style> html { font-size: x-large; color: #2c3e50; } #custom1 { background-color: #ecf0f1; color: #e74c3c; font-family: ”Verdana”, sans-serif; font-weight: bold; } #custom2 { background-color: #ecf0f1; color: #e74c3c; font-family: ”Verdana”, sans-serif; font-weight: bold; all: inherit; } #custom3 { background-color: #ecf0f1; color: #e74c3c; font-family: ”Verdana”, sans-serif; font-weight: bold; all: initial; } #custom4 { background-color: #ecf0f1; color: #e74c3c; font-family: ”Verdana”, sans-serif; font-weight: bold; all: unset; } </style> </head> <body> <p>No all property:</p> <div id=”custom1″>Hello from a creative and innovative universe!</div> <p>all: inherit:</p> <div id=”custom2″>Discover the virtually endless possibilities in your head.</div> <p>all: initial:</p> <div id=”custom3″>Welcome the start of an interesting new trip.</div> <p>all: unset:</p> <div id=”custom4″>Use the power of new ideas to realize your full potential.</div> </body> </html> Print Page Previous Next Advertisements ”;

CSS – Hyphenate Character

CSS – hyphenate-character Property ”; Previous Next CSS hyphenate-character property allows you to specify the character that should be used as the hyphenation point when text is hyphenated using the hyphens property. When text is hyphenated, the browser will insert a hyphen character at appropriate points within words to improve the visual appearance of justified text. The hyphenate-character property allows you to customize the character used for hyphenation. Possible Values <string> − It is used as a <string> at the end of the line before a hyphenation break. auto − Default value. The user-agent determines a suitable string based on the typographic conventions of the content language. Explicit setting is required to override an inherited value. Applies To All elements. Syntax hyphenate-character: <string> | auto; It allows a specific string to replace with hyphen, and instructs the user agent to choose suitable string based on typographic conventions (default). CSS hyphenate-character – auto Value The following example demonstrates the hyphenate-character: auto property allowing automatic hyphenation in the content of the specified element − <html> <head> <style> div { width: 80px; border: 2px solid blue; hyphens: auto; hyphenate-character: auto; } </style> </head> <body> <div>CSS hyphenate­character auto</div> </body> </html> CSS hyphenate-character – <string> Value The following example demonstrates the hyphenate-character property, with different hyphenation characters showing the different effects of the hyphenation behavior − <html> <head> <style> div { width: 80px; border: 2px solid blue; hyphens: auto; } .box1 { hyphenate-character: “=”; } .box2 { hyphenate-character: “*”; } .box3 { hyphenate-character: “%”; } </style> </head> <body> <h3>hyphenate-character: “=”</h3> <div class=”box1”>CSS hyphenate­character auto</div> <h3>hyphenate-character: “*”</h3> <div class=”box2”>CSS hyphenate­character auto</div> <h3>hyphenate-character: “%”</h3> <div class=”box3″>CSS hyphenate­character auto</div> </body> </html> Print Page Previous Next Advertisements ”;

CSS – Arrows

CSS – Arrows ”; Previous Next What is css arrows? Arrows are used in user interfaces to guide users and help them understand the flow of information. They provide visual clues to navigate through different actions. Arrows are an effective way to improve the user experience. They are used in tooltips, dropdown menus, navigation elements, and more. This makes it easier to guide users through a process. Arrows can be created using CSS properties as listed below: transform: This property can be used to create arrow icons by rotating elements using the rotate() function. The rotate() function takes an angle as its argument, which specifies the direction and amount of rotation. border: This property allows us to create a triangle by manipulating the width and height of the element’s border. CSS Arrow Using Transform The transform property can be used to create arrow icons by rotating elements using the rotate() function. The rotate() function takes an angle as its argument, which specifies the direction and amount of rotation − Example Let us see an example for creating an arrow using transform property. <html> <head> <style> .arrow-container { display: flex; align-items: center; } .arrow { display: inline-block; margin-right: 30px; width: 15px; height: 15px; border-top: 2px solid #000; border-right: 2px solid #000; } .right-arrow { transform: rotate(45deg); } .left-arrow { transform: rotate(-135deg); } .up-arrow { transform: rotate(-45deg); } .down-arrow { transform: rotate(135deg); } .top-narrow-arrow { transform: rotate(-45deg) skew(-15deg, -15deg); } .top-wide-arrow { transform: rotate(-45deg) skew(7deg, 7deg); } .top-left-arrow { transform: rotate(-90deg) skew(-10deg, -10deg); } .top-right-arrow { transform: rotate(0) skew(-10deg, -10deg); } .bottom-left-arrow { transform: rotate(180deg) skew(-10deg, -10deg); } .bottom-right-arrow { transform: rotate(90deg) skew(-10deg, -10deg); } </style> </head> <body> <p class=”arrow-container”><span class=”arrow right-arrow”></span> – This arrow points to the right.</p> <p class=”arrow-container”><span class=”arrow left-arrow”></span> – This arrow points to the left.</p> <p class=”arrow-container”><span class=”arrow up-arrow”></span> – This arrow points upwards.</p> <p class=”arrow-container”><span class=”arrow down-arrow”></span> – This arrow points downwards.</p> <p class=”arrow-container”><span class=”arrow top-narrow-arrow”></span> – This arrow points top and is narrow.</p> <p class=”arrow-container”><span class=”arrow top-wide-arrow”></span> – This arrow points top and is wide.</p> <p class=”arrow-container”><span class=”arrow top-left-arrow”></span> – This arrow points top left.</p> <p class=”arrow-container”><span class=”arrow top-right-arrow”></span> – This arrow points top right.</p> <p class=”arrow-container”><span class=”arrow bottom-left-arrow”></span> – This arrow points bottom left.</p> <p class=”arrow-container”><span class=”arrow bottom-right-arrow”></span> – This arrow points bottom right.</p> </body> </html> CSS Arrow Using Border The border property allows us to create a triangle by manipulating the width and height of the element’s border and hence resulting in an arrow. Example Following example demonstrates use of border property to create arrows: <html> <head> <style> .arrow-container { display: flex; align-items: center; } .left-arrow, .right-arrow, .up-arrow, .down-arrow { width: 0; height: 0; margin: 5px; } .left-arrow, .right-arrow { border-top: 18px solid transparent; border-bottom: 18px solid transparent; } .up-arrow, .down-arrow { border-left: 15px solid transparent; border-right: 15px solid transparent; } .right-arrow { border-left: 25px solid #F10C0C; } .left-arrow { border-right: 25px solid #F10C0C; } .up-arrow { border-bottom: 25px solid #F10C0C; } .down-arrow { border-top: 25px solid #F10C0C; } </style> </head> <body> <p class=”arrow-container”><span class=”right-arrow”></span> – This arrow points to the right.</p> <p class=”arrow-container”><span class=”left-arrow”></span> – This arrow points to the left.</p> <p class=”arrow-container”><span class=”up-arrow”></span> – This arrow points to the upwards.</p> <p class=”arrow-container”><span class=”down-arrow”></span> – This arrow points to the downwards.</p> </body> </html> CSS Arrows Styling We can make arrows look more stylish using CSS transformations and border properties as demonstared in the following example. The transform-origin: center property ensures that the rotation of each arrow occurs around its center point. Example Here is an example − <html> <head> <style> .arrow-container { display: flex; align-items: center; } .left-arrow, .right-arrow, .up-arrow, .down-arrow { display: inline-block; margin: 30px; width: 15px; height: 15px; border-top: 2px solid #F10C0C; border-left: 2px solid #F10C0C; transform-origin: center; } .right-arrow { transform: rotate(135deg); } .left-arrow { transform: rotate(-45deg); } .up-arrow { transform: rotate(45deg); } .down-arrow { transform: rotate(-135deg); } .right-arrow::after, .left-arrow::after, .up-arrow::after, .down-arrow::after { content: “”; display: block; width: 2px; height: 45px; background-color: #F10C0C; transform: rotate(-45deg) translate(15px, 4px); } </style> </head> <body> <p class=”arrow-container”>Right Arrow – <span class=”right-arrow”></span></p> <p class=”arrow-container”>Left Arrow – <span class=”left-arrow”></span></p> <p class=”arrow-container”>Up Arrow – <span class=”up-arrow”></span></p> <p class=”arrow-container”>Down Arrow – <span class=”down-arrow”></span></p> </body> </html> Dropdown Arrow You can create a dropdown button with a downward-pointing arrow icon. When you hover over the button, the dropdown menu appears − Example Here is an example − <html> <head> <style> .dropdown { position: relative; display: inline-block; } .dropdown-btn { background-color: #F10C0C; color: #ffffff; padding: 10px; border: none; cursor: pointer; display: flex; align-items: center; } .dropdown-content { display: none; position: absolute; background-color: #28992e; box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2); z-index: 1; } .dropdown-btn::after { content: “”; width: 0; height: 0; border-left: 6px solid transparent; border-right: 6px solid transparent; border-top: 6px solid white; margin-left: 5px; } .dropdown:hover .dropdown-content { display: block; } .dropdown-item { padding: 10px; text-decoration: none; color: #ffffff; display: block; } </style> </head> <body> <div class=”dropdown”> <button class=”dropdown-btn”>Dropdown</button> <div class=”dropdown-content”> <a href=”#” class=”dropdown-item”>Item 1</a> <a href=”#” class=”dropdown-item”>Item 2</a> <a href=”#” class=”dropdown-item”>Item 3</a> </div> </div> </body> </html> Tooltip Arrow We can create a tooltip with an upward-pointing triangular arrow using CSS borders and the transform property. When you hovered over the text tooltip will dispaly and disappears when the mouse cursor is moved away from the text − Example Here is an example − <html> <head> <style> .tooltip { position: relative; display: inline-block; cursor: pointer; } .tooltipcontent { display: none; position: absolute; background-color: #F10C0C; color: #fff; padding: 8px; border-radius: 4px; z-index: 1; font-size: 14px; white-space: nowrap; } .tooltip:hover .tooltipcontent { display: block; } .tooltipcontent::before { content: “”; position: absolute; border-width: 6px; border-style: solid; border-color: transparent transparent #F10C0C transparent; top: -12px; left: 50%; transform: translateX(-50%); } </style> </head> <body> <h3 class=”tooltip”>Tutorialspoint <span class=”tooltipcontent”>CSS – Arrow</span> </h3> </body> </html>

CSS – Visibility

CSS – Visibility ”; Previous Next CSS visibility property allows you to show or hide an element without changing the layout of a document, while hidden elements take up space. The visibility property can be used to create a variety of effects, such as hiding elements that are not yet ready to be displayed, or hiding elements that are only relevant to certain users. Possible Values visible − The element is visible. hidden − The element is hidden, but it still takes up space on the page. collapse − Remove table rows, columns, column groups, and row groups from a table. collapse has the same meaning as hidden if it is used on nontable elements. initial − Sets the visibility of an element to its default value. inherit − Inherits the visibility property from its parent element. Applies to All the HTML elements. DOM Syntax visibility: visible | hidden | collapse | initial | inherit; CSS visibility – visible Value CSS visibility: visible property makes an element visible. This is the default value for the visibility property. <html> <head> <style> h2 { visibility: visible; } </style> </head> <body> <h2>Tutorialspoint CSS visibility</h2> </body> </html> CSS visibility – hidden Value The visibility: hidden property hides an element from the user”s view, but it does not remove it from the document layout. The element will still be accessible to screen readers and will affect the layout of the page, even though it is not visible. <html> <head> <style> h2 { visibility: hidden; } </style> </head> <body> <h2>Tutorialspoint CSS visibility hidden</h2> <p>The hidden heading is still visible to screen readers and takes up space in the page.</p> </body> </html> CSS visibility – collapse Value To remove a table row or column without affecting the layout of the table, you can set the visibility property of the row or column to collapse. This value is only valid for table elements. <html> <head> <style> .collapse { visibility: collapse; } table { border-collapse: collapse; color: #ffffff; width: 100%; background-color: #35DC5A; border: 2px solid black; } th, td { border: 2px solid black; padding: 8px; text-align: left; font-size: 20px; } </style> </head> <body> <table> <tr> <td>visible</td> <td>hidden</td> <td class=”collapse”>collapse</td> </tr> <tr> <td>initial</td> <td>inherit</td> <td>revert</td> </tr> </table> </body> </html> CSS visibility – Collapse On Nontable Elements Following example demonstrates when visibility:collapse is set on nontable elements, here we see the property acts same as visibility:hidden: <html> <head> <style> .collapse { visibility: collapse; } </style> </head> <body> <h2>Collapse on nontable elements</h2> <p class=”collapse”>you cant see me</p> <p>the above sentence is hidden</p> </body> </html> CSS visibility – Transition Effects Following example demonstrates how the element is hidden on hovering over an image: <html> <head> <style> .collapse { visibility: collapse; } img:hover + .hidable { visibility: hidden; } </style> </head> <body> <img src=”images/tutimg.png” style=”cursor:pointer;” /> <h2 class=”hidable”>Hovering over the above image hides me!</h2> </body> </html> Print Page Previous Next Advertisements ”;

CSS – Position

CSS – Position Property ”; Previous Next CSS property position helps manipulate position of an element in a web page. The properties top, bottom, right, and left are used to control its exact position on the page. They specify the offsets of an element from its edges Property position can be used to create floating elements, floating sidebar, and other interactive features. Possible Values static − The element is positioned according to the default or normal flow of the page. So if we set left/right/top/bottom/z-index, then there will be no effect on that element. relative − The element”s orginial position is according to normal flow of the page just like static value. But now left/right/top/bottom/z-index will work. The positional properties push the element from the original position in that direction. absolute − The element is completely removed from the document flow. It is then positioned with respect to its containing block, and its edges are placed using the side-offset properties. An absolutely positioned element may overlap other elements, or be overlapped by them. fixed − The element”s fixed positioning is just like absolute positioning, except the containing block of a fixed element is always the viewport. Here the element is totally removed from the document”s flow and does not have a position relative to any part of the document. sticky − The element sticks to the top of its nearest positioned ancestor that has a “scrolling mechanism” . Applies To All elements. Syntax position: static | relative | absolute | fixed | sticky; CSS position – static Value When you use the position: static property, the element will be positioned normally in the document flow. The left, right, top, bottom, and z-index properties will not affect the element. This is the default value. <html> <head> <style> .normal-box { display: inline-block; background-color: #f2c3ee; border: 1px solid #000000; padding: 10px; margin-bottom: 20px; width: 300px; height: 100px; } .static-box { display: inline-block; position: static; background-color: #bbedbb; border: 1px solid #000000; padding: 10px; width: 300px; height: 100px; } </style> </head> <body> <div class=”normal-box”> <h2>Normal Box</h2> <p>This is a normal box.</p> </div> <div class=”static-box”> <h2>Position: static</h2> <p>This is a box with static position.</p> </div> </body> </html> CSS position – relative Value CSS position: relative property positions the elements relative to their original position in the page. You can use the left, right, top, and bottom properties to move the element around, but it will still take up space in the document flow. <html> <head> <style> .normal-box { display: inline-block; background-color: #f2c3ee; border: 1px solid #000000; padding: 10px; margin-bottom: 20px; width: 300px; height: 100px; } .relative-box { display: inline-block; position: relative; left: 30px; background-color: #bbedbb; border: 1px solid #000000; padding: 10px; width: 300px; height: 100px; } </style> </head> <body> <div class=”normal-box”> <h2>Normal Box</h2> <p>This is a normal box.</p> </div> <div class=”relative-box”> <h2>Position: relative</h2> <p>This is a box with relative position.</p> </div> </body> </html> CSS position – absolute Value An element with position: absolute is taken out of the document flow and positioned relative to its nearest positioned ancestor (if any). If there is no positioned ancestor, then the element is positioned relative to the viewport. You can use top, right, bottom, and left properties to specify the position of the element relative to its containing block. <html > <head> <style> .normal-box { background-color: #f2c3ee; border: 1px solid #333; padding: 10px; margin-bottom: 20px; width: 350px; height: 100px; } .absolute-box { background-color: #bbedbb; border: 1px solid #333; padding: 10px; position: relative; width: 300px; height: 100px; left: 20px; bottom: 20px; } </style> </head> <body> <div class=”normal-box”> <h2>Normal Box</h2> <p>This is a Noraml box.</p> <div class=”absolute-box”> <h2>Position: Absolute</h2> <p>This is a box with absolute position.</p> </div> </div> </body> </html> CSS position – fixed Value To make an element stay in the same place on the screen even when the user scrolls, you can set the position property to fixed. You can then use the left, right, top, and bottom properties to position the element where you want it. <html> <head> <style> .position_container { width: 400px; height: 200px; background-color: #f2c3ee; overflow: auto; padding: 5px; } .fixed-position { position: fixed; top: 15px; left: 60px; padding: 5px; background-color: #bbedbb; text-align: center; } </style> </head> <body> <div class=”position_container”> <p>”Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. “Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p class=”fixed-position”>Tutorialspoint CSS Position Fixed</p> <p>”Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>”Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>”Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> </div> </body> </html> CSS position – sticky Value You can set the position property to sticky to create an element that sticks to the top of the viewport when the user scrolls through a page. The position: sticky property is a combination of the position: relative and position: fixed properties <html> <head> <style> .position_container { width: 400px; height: 200px; background-color: #f2c3ee; overflow: auto; padding: 5px; } .sticky-position { position: sticky; top: 15px; padding: 5px; background-color: #bbedbb; text-align: center; } </style> </head> <body> <div class=”position_container”> <p>”Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. “Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p class=”sticky-position”>Tutorialspoint CSS Position Sticky</p> <p>”Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.</p> <p>”Lorem ipsum dolor sit amet, consectetur adipiscing

CSS – Root

CSS – root ”; Previous Next The :root CSS pseudo-class is designed to select the root element within a document”s hierarchical structure. When applied to HTML, :root specifically points to the <html> element and behaves similarly to the `html` selector. Nonetheless, it”s worth emphasizing that :root possesses greater specificity when compared to `html`. This selector includes all HTML elements or tags. Using :root can be advantageous when declaring global CSS variables. Syntax :root { // css declarations or property –main-color: blue; –secondary-color: white; } CSS root – Declaring Global CSS variables Here is the example that shows usage of :root − <html> <head> <style> :root { –main-color: blue; –secondary-color: white; } body { background-color: var(–main-color); } h1 { color: var(–secondary-color); } </style> </head> <body> <h1>Welcome to CSS Root Example</h1> <p>This is an example of using CSS root to define and use custom CSS variables.</p> </body> </html> CSS root – Styling Different Elements Here is another example that demonstrates the usage of the :root selector for styling different elements − <html> <head> <title>:root Example</title> <style> :root { –primary-color: #007bff; –secondary-color: #6c757d; –background-color: #fcfc90; } body { background-color: var(–background-color); color: var(–secondary-color); font-family: Arial, sans-serif; } h1 { color: var(–primary-color); } p { margin-bottom: 1rem; } .container { max-width: 800px; margin: 0 auto; padding: 2rem; background-color: LightYellow; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); } .button { display: inline-block; padding: 0.5rem 1rem; background-color: var(–primary-color); color: white; text-decoration: none; border-radius: 4px; } </style> </head> <body> <div class=”container”> <h1>:root Example</h1> <p>This is an example of using the <code>:root</code> selector to define global CSS variables.</p> <p>The primary color is set to <span style=”color: var(–primary-color);”>var(–primary-color)</span>.</p> <p>The secondary color is set to <span style=”color: var(–secondary-color);”>var(–secondary-color)</span>.</p> <p>The background color is set to <span style=”background-color: var(–background-color); color: white;”>var(–background-color)</span>.</p> <a href=”#” class=”button”>Demo</a> </div> </body> </html> Print Page Previous Next Advertisements ”;

CSS – Overlay

CSS – Overlay ”; Previous Next An overlay is a transparent layer of content that is placed on top of another element. It can be used to create different effects, such as a modal window, a tooltip, or a popover. The overlay element should be positioned absolutely and have a higher z-index than the content element. This will ensure that the overlay is displayed on top of the content. To create an overlay using CSS, follow these steps: Create two div elements one for the overlay itself and one for the content that you want to overlay. Position the overlay element absolutely on top of the page. Set the width and height of the overlay element to 100%, so that it covers the entire page. Set the background-color of the overlay element to a transparent color, such as rgba(0, 0, 0, 0.5). This will make the overlay visible. Set the z-index of the overlay element to a value higher than the z-index of any other elements on the page. This will ensure that the overlay is always displayed on top of all other elements. CSS Overlay – Basic Example The following example shows an overlay effect that appears when you click a button and disappears when you click anywhere on the page. JavaScript can be used to show and hide the overlay div element by using the querySelector() method to get the overlay element. When the button is clicked, a function is executed that toggles the display property of the overlay container between block (visible) and none (hidden). <html> <head> <style> .overlay-container { position: fixed; display: none; width: 100%; height: 100%; text-align: center; background-color: rgba(213, 86, 207, 0.3); z-index: 999; cursor: pointer; } .overlay-content { padding: 20px; } .overlay-button { background-color: #38dc29; color: white; border: none; padding: 20px; cursor: pointer; font-size: 20px; text-align: center; display: block; margin: 50px auto; } </style> </head> <body> <div class=”overlay-container” onclick=”overlayFun()”> <h1>Tutrialspoint CSS Overlay</h1> </div> <div style=”padding:20px”> <button class=”overlay-button” onclick=”overlayFun()”>Click on Button</button> </div> <script> let overlayVisible = false; function overlayFun() { const overlay = document.querySelector(“.overlay-container”); overlay.style.display = overlayVisible ? “none” : “block”; overlayVisible = !overlayVisible; } </script> </body> </html> CSS Overlay – Top to Bottom Sliding There are four different ways to create a sliding overlay effect: top, bottom, left, and right. We will discuss each type one by one with an example. The following example shows an image with an overlay that slides down from the top of the image to the bottom when the user hovers over it − <html> <head> <style> .overlay-container img { width: 200px; height: 200px; margin-left: 40%; } .overlay-container { position: relative; width: 25%; height: auto; } .overlay-container:hover .top-bottom { opacity: 1; height: 200px; } .top-bottom{ position: absolute; transition: 0.9s ease; opacity: 0.3; width: 200px; border-radius: 5px; height: 0; top: 0; left: 40%; background-color: #d346e6; text-align: center; color: #ffffff; } h2 { text-align: center; } </style> </head> <body> <h2>To see the effect, hover your cursor over the image.</h2> <div class=”overlay-container”> <img src= “images/tutimg.png”> <div class=”top-bottom”> <h2>Top to Bottom Image Overlay</h2> </div> </div> </body> </html> CSS Overlay – Bottom to Top Sliding The following example shows an image with an overlay effect that slides up from the bottom of the image to the top when the user hovers over it − <html> <head> <style> .overlay-container img { width: 200px; height: 200px; margin-left: 250px; } .overlay-container { position: relative; width: 25%; height: auto; } .overlay-container:hover .bottom-top { opacity: 1; height: 200px; } .bottom-top { position: absolute; transition: 0.9s ease; opacity: 0.3; width: 200px; border-radius: 5px; height: 0; bottom: 0; left: 250px; background-color: #d346e6; text-align: center; color: #ffffff; } h2 { text-align: center; } </style> </head> <body> <h2>To see the effect, hover your cursor over the image.</h2> <div class=”overlay-container”> <img src= “images/tutimg.png”> <div class=”bottom-top”> <h2>Bottom to Top Image Overlay</h2> </div> </div> </body> </html> CSS Overlay – Left to Right Sliding The following example shows an image with an overlay effect that slides from left to right when you hover over it − <html> <head> <style> .overlay-container img { width: 200px; height: 200px; margin-left: 250px; } .overlay-container { position: relative; width: 25%; height: auto; } .overlay-container:hover .left-right { opacity: 1; width: 200px; } .left-right { position: absolute; transition: 0.9s ease; opacity: 0.3; width: 0; border-radius: 5px; height: 200px; top: 0; left: 0; margin-left: 250px; background-color: #d346e6; text-align: center; color: #ffffff; } h2 { text-align: center; } </style> </head> <body> <h2>To see the effect, hover your cursor over the image.</h2> <div class=”overlay-container”> <img src=”images/tutimg.png”> <div class=”left-right”> <h2>Left to Right Image Overlay</h2> </div> </div> </body> </html> CSS Overlay – Right to Left Sliding The following example shows an image with an overlay effect that slides from right to left when you hover over it − <html> <head> <style> .overlay-container img { width: 200px; height: 200px; margin-left: 250px; } .overlay-container { position: relative; width: 67%; height: auto; } .overlay-container:hover .right-left { opacity: 1; width: 200px; } .right-left { position: absolute; transition: 0.9s ease; opacity: 0.3; width: 0; border-radius: 5px; height: 200px; top: 0; right: 0; background-color: #d346e6; text-align: center; color: #ffffff; } h2 { text-align: center; } </style> </head> <body> <h2>To see the effect, hover your cursor over the image.</h2> <div class=”overlay-container”> <img src=”images/tutimg.png”> <div class=”right-left”> <h2>Right to Left Image Overlay</h2> </div> </div> </body> </html>

CSS – Cursor

CSS – cursor Property ”; Previous Next The CSS cursor property determines the appearance of the mouse cursor when hovering over an element to which this property is applied. This property is only applicable in environments with mouse and cursor functionality. Its main purpose is to improve usability by visually representing certain functions. Possible Values The cursor property can have following values: <url>: (optional) You have the flexibility to use a series of url() values separated by commas, with each url() pointing to an image file. <x> <y>: (optional) You have the option to specify x and y coordinates that define the hotspot of the cursor and specify the exact position within the cursor image that the cursor points to. <keyword>:A keyword value is required that specifies either the cursor type to use or the alternate cursor to use if none of the specified symbols can be loaded. The following table lists the available keywords. Category Value Example Description General auto The displayed cursor is determined by the user agent based on the current context. This is the default property that the browser uses to define the cursor. default The default cursor, which varies depending on the platform, is usually displayed as an arrow. none There is no cursor displayed. Links and Status context-menu The displayed cursor is context menu cursor, showing there is access to a context menu. help The displayed cursor is help cursor, showing information for assistance is accessible. pointer The displayed cursor is pointer cursor, showing the cursor serves as an indicator pointing to a hyperlink. progress The displayed cursor is progress cursor, showing the program is performing background tasks, allowing the user to maintain interaction with the interface instead of having to wait for its completion. wait The displayed cursor is cursor, The program is currently occupied, and the user cannot engage with the interface, this state is sometimes represented by an image of an hourglass or a watch. Drag and Drop alias The displayed cursor is alias cursor, showing there is need to generate an alias or shortcut. copy The displayed cursor is copy cursor, showing there is a requirement to create a copy of something. move The displayed cursor is move-cursor, showing something can be relocated. no-drop The displayed cursor is no-drop cursor, showing it may not be possible to place the item in its current location. not-allowed The displayed cursor is not-allowed cursor, showing the requested action will not be performed. grab The displayed cursor is grab cursor, showing that can grab the element and can be dragged to relocate it. grabbing The displayed cursor is grabbing cursor, showing something is being held or pulled to facilitate its movement. Selection cell The displayed cursor is cell cursor, showing the option to select the table cell or a group of cells. crosshair The displayed cursor is Crosshair cursor, commonly used to indicate the selection of elements in a bitmap. text The displayed cursor is text cursor, showing you can select the text that is normally indicated by an I-shaped cursor. vertical-text The displayed cursor is veritcal text cursor, showing you can select the vertical text, which is often indicated by a side-aligned I bar. Zooming zoom-in The displayed cursor is zoom-in, showing an object can be enlarged through zooming . zoom-out The displayed cursor is zoom-out, showing an object can be shrunk through zooming . Resizing and Scrolling all-scroll The displayed cursor is all scroll cursor, can scroll something in any direction, which is also referred to as panning. col-resize The displayed cursor is coloumn-resize cursor, showing element or column may be subject to horizontal resizing, often represented as arrows pointing left and right, separated by a vertical bar. row-resize The displayed cursor is row-resize cursor, showing element or line may be subject to vertical resizing, usually represented by arrows pointing both upward and downward, separated by a horizontal bar. n-resize The displayed cursor is north direction resize cursor, showing north side can be moved or shifted. e-resize The displayed cursor is east direction resize cursor, showing east side can be moved or shifted. s-resize The displayed cursor is south direction resize cursor, showing south side can be moved or shifted. w-resize The displayed cursor is west direction resize cursor, showing west side can be moved or shifted. ne-resize The displayed cursor is north-east resize cursor, showing cursor for bidirectional resizing. nw-resize The displayed cursor is north-west resize cursor, showing cursor for bidirectional resizing. se-resize The displayed cursor is south-east resize cursor, showing cursor for bidirectional resizing. sw-resize The displayed cursor is south-west resize cursor, showing cursor for bidirectional resizing. ew-size The displayed cursor is east-west resize cursor, showing cursor for bidirectional resizing. ns-resize The displayed cursor is north-south resize cursor, showing cursor for bidirectional resizing. nesw-resize The displayed

CSS – Quotes

CSS – quotes ”; Previous Next CSS quotes property allows browser to render quotation marks for the content. Quotes can be added to any element. They seek the benefit of pseudo-elements ::before and ::after to insert the quotation marks at the beginning and at the end of a quote. These pseudo-elements are defined by the content property. This CSS quotes specifies how the browser should render quotation marks that are added using the open-quote and close-quote values of the content property. Possible Values none − The open-quote and close-quote values of the content property produce no quotation marks. string,string,+ − One or more pairs of string values for open-quote and close-quote. The first pair represents the outer level of quotation. The second pair is for the first nested level and next pair for third level and so on. initial − Depends on user agent auto − Appropriate quote marks will be used for whatever language value is set on the selected elements (i.e. via the lang attribute). Applies to All elements. Syntax Keyword Value quotes: none; quotes: auto; <string> Value quotes: “«” “»”; quotes: “«” “»” “‹” “›”; Following table describes the various quotation mark characters: Quotes Description Entity Number “ double quotes 022 ” single quote 027 < single, left angle quote 2039 > single, right angle quote 203A << double, left angle quote 0AB >> double, right angle quote 0BB >> double, right angle quote 0BB ‘ left quote (single high-6) 2018 ’ right quote (single high-9) 2019 “ left quote (double high-6) 201C ” right quote (double high-9) 201D „ double quote (double low-9) 201E CSS quotes – none Value The none value for the quotes property indicates that open-quote and close-quote values of the content property produce no quotation marks. Following example demonstartes this: <html> <head> <style> p { quotes: none; } p:before { content: open-quote; } p:after { content: close-quote; } </style> </head> <body> <p>Tutorialspoint CSS Quotes set to &lti&gtnone&lt/i&gt</p> </body> </html> CSS quotes – <string> Value Following example demonstartes specifies which quotation marks to use when string,string,+ value is used. The first value specifies the first level of quotation embedding, the next two values specifies the next level of quote embedding, and so on <html> <head> <style> #quote1 { quotes: ”‘” ”’”; } #quote2 { quotes: ””” ”””; } #quote3 { quotes: ”<” ”>”; } #quote4 { quotes: ”<<” ”>>”; } #quote5 { quotes: “<<” “>>” “<” “>”; } #quote6 { quotes: ”2018” ”2019”; } #quote7 { quotes: ””” 00AB” ” 0BB”; } #quote8 { quotes: ”2039” ”203A”; } #quote9 { quotes: ”0AB” ”0BB”; } #quote10 { quotes: ”201D” ”201E”; } </style> </head> <body> <h3>Using quotes symbol:</h3> <p><q id=”quote1″>Tutorialspoint CSS Quotes.</q></p> <p><q id=”quote2″>Tutorialspoint CSS Quotes</q>.</q></p> <p><q id=”quote1″>Tutorialspoint CSS <q id=”quote2″>Quotes</q>.</q></p> <p>Tutorialspoint CSS <q id=”quote3″>Quotes</q>.</p> <p><q id=”quote4″>Tutorialspoint CSS Quotes</q>.</q></p> <p><q id=”quote5″>Tutorialspoint CSS<q id=”quote5″>Quotes</q>.</q></p> <h3>Using entity number:</h3> <p><q id=”quote6″>Tutorialspoint CSS Quotes.</q></p> <p><q id=”quote6″>Tutorialspoint CSS<q id=”quote6″>Quotes</q>.</q></p> <p><q id=”quote7″>Tutorialspoint CSS Quotes.</q></p> <p>Tutorialspoint CSS <q id=”quote8″>Quotes</q>.</p> <p><q id=”quote9″>Tutorialspoint CSS <q id=”quote9″>Quotes</q>.</q></p> <p><q id=”quot10″>Tutorialspoint CSS Quotes.</q></p> </body> </html> CSS quotes – initial Value Followig example demonstrates use of the quotes: initial; property value. This values sets default values to quotes. <html> <head> <style> q { quotes: initial; } </style> </head> <body> <p><q>Tutorialspoint CSS Quotes.</q></p> </body> </html> CSS quotes – auto Value Sets the quotes property to the value auto that automatically determines the correct quotation marks based on the language – as demonstrated in the following example: <html> <head> <style> q { quotes: auto; } </style> </head> <body> <div lang=”fr”> <q>Tutorialpoint est un site de cours d”anglais.</q> </div> <hr /> <div lang=”ru”> <q>Tutorialpoint — сайт курсов английского языка.</q> </div> <hr /> <div lang=”de”> <q>Tutorialpoint is een Engelse cursuswebsite</q> </div> <hr /> <div lang=”en”> <q>Tutorialpoint is an english course website.</q> </div> </body> </html> CSS quotes – Using :lang pseudo-class You can also use the :lang pseudo-class to define different styles for quotation marks based on the language attribute (lang) within the elements. The :lang(en) rule defines styles for elements with the English language attribute. The :lang(fr) rule defines styles for elements with the French language attribute. Let us see an example − <html> <head> <style> :lang(en) { quotes: “#” “#” “<<” “>>”; } :lang(fr) { quotes: ”2039” ”203A”; } </style> </head> <body> <p><q lang=”en”>Tutorialspoint CSS <q lang=”en”>Quotes</q>.</q></p> <p>Tutorialspoint CSS <q lang=”fr”>Quotes</q>.</p> </body> </html> Print Page Previous Next Advertisements ”;

CSS – Hyphens

CSS – hyphens ”; Previous Next CSS hyphens property controls how words are broken into lines when text is too long to fit on a single line. This property can be used to improve the readability of text that wraps across multiple lines. The property only applies to block-level elements. Following are all possible values that can be used for property hypens: none − No hyphenation is allowed. manual − It specifoes manual hyphenation behavior for text in WebKit-based browsers. auto − Hyphenation is allowed at appropriate hyphenation points, as determined by the browser. initial − The initial value, which is manual. inherit − The value inherited from the parent element. CSS hyphens – none Value The hyphens: none property value prevents hyphenation of words. It will not be broken into lines, even if they are too long to fit on a single line. <html> <head> <style> .container { border: 2px solid #12782f; background-color: #2fe262; width: 60px; } .hyphenated-none { hyphens: none; } </style> </head> <body> <div class=”container”> <p class=”hyphenated-none”>It is a long established Contrary to popularised.</p> </div > </body> </html> CSS hyphens – manual Value When you use the CSS hyphens: manual property, hyphenation is only allowed at points where the user has explicitly inserted hyphens. This is a default value. <html> <head> <style> .container { border: 2px solid #12782f; background-color: #2fe262; width: 60px; } .hyphenated-manual { hyphens: manual; } </style> </head> <body> <div class=”container”> <p class=”hyphenated-manual”>It is a long establ-ished Contrary to popula-rised.</p> </div > </body> </html> CSS hyphens – auto Value You can use the CSS hyphens: auto property to let the browser automatically hyphenate words at points that are considered to be appropriate, according to the language”s hyphenation rules. <html> <head> <style> .container { border: 2px solid #12782f; background-color: #2fe262; width: 60px; } .hyphenated-auto { hyphens: auto; } </style> </head> <body> <div class=”container”> <p class=”hyphenated-auto”>It is a long established Contrary to popularised.</p> </div> </body> </html> CSS hyphens – initial Value CSS hyphens: initial property sets the hyphens property to its initial value. The initial value for the hyphens property is manual, which means that hyphenation is only allowed at points where the user has explicitly inserted hyphens. <html> <head> <style> .container { border: 2px solid #12782f; background-color: #2fe262; width: 60px; } .hyphenated-initial { hyphens: initial; } </style> </head> <body> <div class=”container”> <p class=”hyphenated-initial”>It is a long establ-ished Contrary to popu-larised.</p> </div > </body> </html> CSS hyphens – inherit Value When you use the hyphens: inherit property, the value of the hyphens property is inherited from the parent element. The hyphenation of the element will be the same as the hyphenation of its parent element. <html lang=”en”> <head> <style> .container { border: 2px solid #12782f; background-color: #2fe262; width: 60px; padding: 2px; hyphens: auto; } .hyphenated-inherit { border: 2px solid #ac3f08; background-color: #f05e40; hyphens: inherit; } </style> </head> <body> <div class=”container”> There are many variations of embarrassing of Lorem Ipsum. <p class=”hyphenated-inherit”>It is a long establ-ished Contrary to popu-larised.</p> </div > </body> </html> Print Page Previous Next Advertisements ”;