반응형

비전 프로 출시 D-2

Vision Pro Review: 24 Hours With Apple’s Mixed-Reality Headset | WSJ

 

https://www.youtube.com/watch?v=8xI10SFgzQ8

실리콘밸리 시간으로는 3일, 한국시간으로는 2일 후 애플의 신형 디바이스인 비전 프로가 판매를 드디어 시작하는데요. 미국의 미디어 유튜버들의 제품 리뷰와 영상이 본격적으로 공개되기 시작했어요. 유튜브나 뉴스검색을 통해서 찾아보실 수 있는데요. 리뷰어들의 소감 중에서 재미있는 것을 정리해봤어요. 

 

  • 무겁다 : 실제 무게도 있지만 메타 퀘스트와 달리 무게가 앞에 쏠려있는 점이 문제.
  • 가상 키보드는 별로 : 비전 프로로 일을 하고 싶다면 실물 키보드를 추천.
  • 안경은 못쓴다 : 안경을 쓰고 착용하기 어렵기 때문에 도수가 있는 렌즈를 별도로 구매해서 부착해야해요.  
  • 놀라운 디스플레이 : 디스플레이 성능이 너무 좋은데 이것이 높은 가격의 가장 큰 원인 중 하나. 
  • 패스스루도 완벽 : 비전 프로를 착용해도 카메라를 통해서 외부를 보는 혼합현실(Mixed Reality)기능이 매우 훌륭하다고 해요. 
  • 시리를 많이 사용하게 된다 : 음성 AI 비서인 시리가 비전프로에서도 당연히 작동을 하는데, 비전프로를 쓰고 있는 환경에서는 자연스럽게 시리를 호출해서 명령을 내리는 경우가 많아요. 마치 아이언맨이 자비스를 부르는 것 처럼요.  
  • 3D 영상 촬영이 킬러 서비스 : 아이폰15 프로로 공간동영상(Spatial)을 촬영할 수 있는데, 이걸 비전 프로에서 볼 수 있어요. 많은 리뷰어들이 여기에 만족을 나타냈어요. 2D 영상을 보는 것보다 과거의 경험을 다시 생생하게 느낄 수 있다고 해요. 특히 아이의 영상을 찍은 부모들의 만족도가 높았어요. 과거 캠코더가 아이들의 영상을 찍기 위해 많은 부모들이 샀던 것처럼 비전 프로 수요도 있을 것 같아요.  
  • 침대에 누워서 쓰기 좋다 : 침대에서 스마트폰을 쓰는 분들이 많은데, 비전 프로를 쓰면 무게도 덜 느끼고 좋을 것 같아요.

패스스루란?

패스스루는 VR 화면에서 벗어나 주변의 실제 환경을 볼 수 있게 해주는 기능입니다. 패스스루는 헤드셋의 센서를 사용하여 사용자가 헤드셋 너머의 실제 환경을 본다고 가정했을 때 보게 될 환경을 대략적으로 보여줍니다. 안전 보호 경계를 만들거나 조정할 때 자동으로 패스스루가 작동합니다. 실제 및 가상 환경을 혼합하기 위해 앱에도 패스스루가 표시됩니다.

반응형
반응형

https://medium.com/@anirudh.munipalli/10-powerful-css-properties-that-every-web-developer-must-know-e5d7f8f04e10

You probably never heard of them, but you will love them once you know.

CSS.

A language which is responsible for nearly every website in the world.

With so many properties, CSS is pretty huge. Finding good properties among them is like trying to read a binary file by yourself (pls don’t try it).

Which is why I have done that for you (the CSS, not the binary).

Here are 10 properties that you may not use much, or have never heard of, but will love once you know them.

Photo by Markus Spiske on Unsplash

Custom Scrollbars

Let’s change the width and color of the scroll bar. Also, let’s make it a little round as well.

Below are the parts of a scroll bar.

What the different parts of a scroll bar are | Image by Author

We use ::-webkit-scrollbar to change the properties.

/* Set the width of the scroll bar*/
::-webkit-scrollbar{
    width: 10px;
}
/* Change the track to a blue color and give a round border */
::-webkit-scrollbar-track{
    background-color: blue;
    border-radius: 10px;
}
/* Making the thumb (which shows how much you've scrolled) a gray color
  and making it round */
::-webkit-scrollbar-thumb{
    background: gray;
    border-radius: 10px
}
/* A dark gray color when hovered overn */
::-webkit-scrollbar-thumb:hover{
    background: darkgray;
}

The result of the code | Image by Author

Note: This is a non-standard property, and without -webkit-, it will not work.

Cursors

Change how the cursor looks when you mouse over an element.

/* An element with class 'first' */
.first{
    cursor: not-allowed;
}
/* An element with class 'second' */
.second{
    cursor: zoom-in;
}
/* An element with class 'third' */
.third{
    cursor: crosshair;
}

Result of the above code. The cursor on different elements | Image by Author

Scroll behavior

The scroll behavior can make a smooth scroll, to make transition from one section to another smoother.

Add this simple line and see the effect for yourself.

html{
  scroll-behavior:smooth;
}

Instead of simply snapping the page from one section to another, it scroll up/down to the section. See the effect here.

Accent color

Change the color for user interface, such as form controls and checkboxes.

Accent color demo | Image by Author

See how the color of the check box and radio button is blue, instead of the default (and boring) gray.

input{
  accent-color: blue;
}

That’s all. You can use selectors to make some inputs blue, some red and some green.

And this doesn’t change the color of the text, so you can mess around with the colors and experiment. The UI color is under our control.

Aspect Ratio

When building responsive components, constantly keeping check on the height and width might be a headache, as you have to maintain aspect ratios. Videos, and Images may appear stretched sometimes.

That is why we can use the aspect ratio property. Once you set the aspect ratio value, and then set width, the height is set automatically. Or the other way around.

/* An elment with class example */
.example{
    /* Setting the aspect ratio */
    aspect-ratio: 1 / .25;
    /* Upon setting width, height is automatically set */
    width: 200px;
    /* Border is not required, but it is here just to see the effect. */
    border: solid black 1px;
}

Now that we set the width, we will get the height equal to 125 px automatically, to maintain the aspect ratio. This is very useful for responsive behavior.

The result when the CSS is applied to the HTML | Image by Author

Box Reflect

This allows us to create reflections of an component below it.

For this demo, I used an SVG wave image, that I got using this website.

/* An element with class name 'example */
.example{
    /* The reflection will appear below. Other possible values are above | left | right */
    -webkit-box-reflect: below;
}

This creates a reflection below the SVG.

Box reflection below the image | Image by Author

We can also offset the reflection a bit.

/* An element with class name 'example */
.example{
    /* The reflection will appear below. Other possible values are above | left | right */
    -webkit-box-reflect: below 20px;
}

The reflection with offset | Image by Author

Also, I would like it to fade out a bit. We can use a gradient for that.

/* An element with class name 'example */
.example{
    /* The reflection will appear below. Other possible values are above | left | right */
    -webkit-box-reflect: below 0px linear-gradient(to bottom, rgba(0,0,0,0), rgba(0,0,0,.5));
}

This gives a nice reflection.

The resulting reflection | Image by author

This is a non-standard property supported by most major browsers (except Firefox).

Check if browser supports a property

How to check if a particular property is supported in CSS.

/* Check if browser supports display: flex */
@supports (display: flex){
    /* If it does, set the display to flex */
    div{
        display: flex
    }
}

While the above example will always be supported by major browsers, non-standard properties (such as custom scroll bars and box-reflections) might not be supported by some.

Remember to put the condition in () parenthesis.

If you put the not keyword, then it will work if the property is not supported.

@supports not (display: flex){/* If not supported *}

Masks

You can use an Image mask in CSS.

/* An object with class example */
.example{
    /* Setting the mask from a URL */
    -webkit-mask: url(YOUR URL);
    mask: url(YOUR URL);
}

In the mask image, the white represents the mask and black is the area to be clipped.

Filter

You can add amazing filters to your images using CSS. Filters are something we see in every photo sharing app, and now, let’s see how easy they are to implement

img{
    filter: /*YOUR VALUE */;
}

There are many filters available. You can blur, brighten and saturate filters. You can make the image grayscale, change it’s opacity, invert the colors, and more.

The normal image (left), blurred image(middle) and high contrast image(right) | Image by Author | Photo of grass by Author

A brightened image (left), a grayscale image (middle) and a hue rotated image (right) | Image by Author | Photo of grass by Author

See this page for more details.

Backdrop effects

You can add a good looking filter to the area behind an image using backdrop-filter.

All the properties of filter are available here. This is in other words just a filter to apply to the background.

<div class="image">
    <div class="effect">
        backdrop-filter: blur(5px);
    </div>
</div>

<style>
.image{
    background-image: url(YOUR URL);
    background-size: cover;
    width: 400px;
    height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.effect{
    font-size: x-large;
    color: white;
    font-weight: 800;
    background-color: rgba(255, 255, 255, .3);
    backdrop-filter: blur(5px);
    padding: 20px;
}
</style>

This makes an effect like this:

Result of the code | Image by Author

And with that, you now know 10 new properties of CSS. You can make your website look very professional.

If you like this article, show your support by:

  1. Clapping
  2. Following for content about CSS, HTML, JS, Python and AI.
  3. Responding to this article telling your favorite property.
  4. Or do all of the above 3 😃
반응형
반응형

[ICON] ion-icon 아이콘 사용하기 

https://ionic.io/ionicons

 

Ionicons: The premium icon pack for Ionic Framework

Ionicons is an open-sourced and MIT licensed icon pack.

ionic.io

Installation

If you're using Ionic Framework, Ionicons is packaged by default, so no installation is necessary. Want to use Ionicons without Ionic Framework? Place the following <script> near the end of your page, right before the closing </body> tag, to enable them.

<script type="module" src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.esm.js"></script>
<script nomodule src="https://unpkg.com/ionicons@7.1.0/dist/ionicons/ionicons.js"></script>

Basic usage

To use a built-in icon from the Ionicons package, populate the name attribute on the ion-icon component:

<ion-icon name="heart"></ion-icon>
반응형
반응형

Magic inspired Social Share Button
-- https://codepen.io/codingstella/pen/gOQqaWo

https://codepen.io/codingstella/pen/gOQqaWo

 

Magic inspired Social Share Button

...

codepen.io

https://codepen.io/codingstella/

 

Coding Stella on CodePen

Amazing CSS Animation That You Have Never Seen 🤒

codepen.io

<script src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.esm.js"></script>
<script src="https://unpkg.com/ionicons@5.5.2/dist/ionicons/ionicons.js"></script>
<script src="https://cdpn.io/cpe/boomboom/pen.js?key=pen.js-ae5cde2e-fb64-f510-42d5-4efea99ca66b" crossorigin=""></script>

<div class="menu">
  <div class="toggle">
    <ion-icon name="share-social"></ion-icon>
    </div>
  
      <li style="--i:0;--clr:#1877f2">
      <a href="#"><ion-icon name="logo-facebook"></ion-icon></a>
    </li>
    <li style="--i:1;--clr:#25d366">
      <a href="#"><ion-icon name="logo-whatsapp"></ion-icon></a>
    </li>
    <li style="--i:2;--clr:#1da1f2">
      <a href="#"><ion-icon name="logo-twitter"></ion-icon></a>
    </li>
     <li style="--i:3;--clr:#FF5733">
      <a href="#"><ion-icon name="logo-reddit"></ion-icon></a>
    </li>
    <li style="--i:4;--clr:#0a66c2">
      <a href="#"><ion-icon name="logo-linkedin"></ion-icon></a>
    </li>
    <li style="--i:5;--clr:#c32aa3">
      <a href="#"><ion-icon name="logo-instagram"></ion-icon></a>
    </li>
    <li style="--i:6;--clr:#1b1e21">
      <a href="#"><ion-icon name="logo-github"></ion-icon></a>
    </li>
    <li style="--i:7;--clr:#ff0000">
      <a href="#"><ion-icon name="logo-youtube"></ion-icon></a>
    </li>
</div>
*{
  margin:0;
  padding:0;
  box-sizing:border-box;
}
body{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100vh;
  background: #262433;
}
.menu{
  position:relative;
 width:280px;
  height:280px;
  display:flex;
  align-items:center;
  justify-content:center;
}
.menu .toggle{
  position:relative;
  height:60px;
  width:60px;
  background:#fff;
  border-radius:50%;
  box-shadow:0 3px 4px rgba(0,0,0,0.15);
  display:flex;
  align-items:center;
  justify-content:center;
  color:#333;
  font-size:2rem;
  cursor:pointer;
  transition:1.25s;
  z-index:5;
}
.menu.active .toggle{
  transform:rotate(360deg);
  box-shadow: 0 6px 8px rgba(0,0,0,0.15),
    0 0 0 2px #333,
    0 0 0 8px #fff;
}
.menu li{
  position:absolute;
  left:0;
  list-style:none;
  transition:0.5s;
  transform:rotate(calc(360deg/8 * var(--i)));
  transform-origin:140px;
  scale:0;
  transition-delay: calc(0.05s * var(--i));
}
.menu.active li{
  scale:1;
}
.menu li a{
  position:relative;
  display:flex;
 transform:rotate(calc(360deg/-8 * var(--i)));
  width:60px;
  height:60px;
  background-color:#FFF;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius:50%;
  font-size:1.75rem;
  color:var(--clr);
   box-shadow:0 3px 4px rgba(0,0,0,0.15);
  transition:0.5s;
}
.menu li:hover a{
  font-size:2.5rem;
  box-shadow:0 0 0 2px var(--clr),
    0 0 0 6px #fff;
}
const menu=document.querySelector(".menu");
const toggle=document.querySelector(".toggle");
toggle.addEventListener("click",()=>{
  menu.classList.toggle("active");
})
반응형
반응형

 

The days are long gone when a viewer’s attention is quickly captured by a simple and plain HTML website. The trend has changed and moved more towards animation and graphics with several upgrades to technology and design. When you develop a website, it requires both creative and technical skills. Things like layouts, animations, and graphics can greatly overhaul your website’s look and feel.

As you already know, Cascading Style Sheets, or CSS, is an ideal way to spice up your web design. It is a fundamental technology that allows developers to control their websites’ or web apps’ layout and visual appearance.

According to W3Techs, as of January 2023, approximately 96.9% of websites use CSS, which itself shows it is an integral part of modern web design.

As web development evolves, new CSS trends are emerging to help developers create more visually stunning websites. From responsive design and animation to new techniques and styling, CSS trends are constantly changing and adapting to meet the needs of modern web design. Since CSS trends are cyclical, it’s reasonable to assume that by 2023 there will be some new CSS trends in web development.

In this article, discover the best 15 CSS trends to look for in 2023. These trends will help you create visually stunning responsive designs by unleashing the power of CSS.

Also, don’t forget to read this tutorial about ServiceNow Testing, to know what it is, it’s benefits, types and test cases: https://www.lambdatest.com/learning-hub/servicenow-test-case-template

How does CSS help your website?

CSS stands for Cascading Style Sheet. It is a language for creating a Style Sheet that describes the layout and formatting of a document written in a markup language. It works with HTML to modify the look and feel of online pages and user interfaces. Any XML document type, including plain XML, SVG, and XUL, can be used with it.

With the help of CSS, you can make changes to old HTML-written documents or create a new style with the CSS codes. Here are some benefits CSS offers to your website.

  • Before, tags, such as font, color, background, etc., were repetitive in websites, and CSS was developed to solve this problem.
  • Help you create a consistent design across multiple web pages and offers reusability to use styling on different elements and websites.
  • CSS offers more specific attributes than plain HTML to define the website’s look and feel.
  • Provide visual cues to improve the website’s accessibility.
  • Boost website SEO by presenting the digital content clearly and concisely.

2023 CSS Trends to Follow

Now you have got a gist of CSS and its benefits, let’s start with our list of best CSS trends for 2023.

Note: The browser compatibility data herein have been taken from CanIUse.

1. CSS Grid

CSS Grid is a powerful layout module that allows you to create sophisticated responsive grid layouts. It’s fully supported by modern browsers and is gaining popularity among web developers. This amazing CSS trend can handle both rows or columns easily.

Subgrid is a handy feature that has been added to the Grid Layout. You can create a Subgrid using the Subgrid feature that will mimic the layout of its parent grid. The child grid chooses its dimensions and gaps when nested inside another grid display. The layout of the parent grid is applied to the Subgrid, although the Subgrid can still override certain parts if necessary.

Browser Support: 95.91%

Discover the top 90+ essential Shopify test cases to ensure your store’s functionality, performance, and customer experience. Download our comprehensive template now: https://www.lambdatest.com/learning-hub/shopify-test-case-template

2. CSS Writing Mode

Depending on the language, the CSS Writing Mode property adjusts the text’s alignment so that it can be read either from top to bottom or from left to right. Say, for instance, that we wish to add some text that is read from left to right and from top to bottom.

This is helpful for languages where the text is frequently positioned vertically, like Chinese, Japanese, or Korean. You’ll likely want to employ this quality in English for aesthetic reasons with the help of this CSS trend.

Browser Support: 97.7%

3. Scroll Snap Behavior

To control a web browser’s CSS scroll snap behavior, CSS offers a valuable collection of attributes. Some of this functionality has been there for extended, but more recent browser versions are just now getting access to others. The best thing about this CSS trend is that just one-third of CSS users know about it.

Using the scroll-snap-type property, you can modify the scroll position on a container in various ways. Developers gain greater precision while end users enjoy a smoother, more controllable user experience.

Browser Support: 95.89%

4. Container Queries

CSS has not yet fully established container queries, though they will. They’ll have a significant influence on how we perceive responsive design. The fundamental notion is that you can specify a breakpoint depending on the size of a parent container in addition to the viewport and media.

It will include adjusting a layout based on the dimensions of various containers that appear throughout the nested layers of a user interface. Rather than a CSS trend, CSS Container Queries is a significant move that will probably spark a wave of UI enhancements.

Browser Support: 76.94%

Do check, Our tutorial on Website Builder Test Case Templates offers comprehensive guide for effective website testing. Start optimizing your website’s quality today: https://www.lambdatest.com/learning-hub/website-builder-test-case-template

5. New Color Palettes

CSS practitioners are already using RGB to beautify web pages. Recently CSS introduced three new color pallets HWB, LAB, and LCH.

HWB: It is an acronym for Hue, Whiteness, and Blackness. It’s an easy feature for people to read: you choose a color and then add white and black. Recent releases of Chrome, Firefox, and Safari all support it.

Browser Support: 87.71%

LAB: It is created from CIA LAB color theory and is considered the most theoretically complex of new color spaces. It is a bold claim that the LAB color descriptor includes all colors humans can perceive. Only Safari is now compatible with this CSS trend, just like LCH.

LCH: It stands for Lightness, Chroma, and Hue and is renowned for broadening the palette of colors that are accessible. Safari only supports LCH.

Browser Support: 15.38%

6. CSS Variables

CSS Variables, also known as CSS Custom Properties, has been a popular CSS trend in the market since 2015 and are now getting more and more attention from CSS users. CSS Variables allow you to store and use a value elsewhere in the HTML code. It helps to remove redundancy in codes, flexibility, and improve the readability of codes.

Browser Support: 95.81%

Over 57 different e-commerce websites and application test cases are covered to guarantee a flawless and secure purchasing experience for customers: https://www.lambdatest.com/learning-hub/ecommerce-test-cases

7. Viewport Units

Setting viewport units is a hassle for everyone who has attempted to code a website for Safari on iOS. The mobile browser shows containers set to a size in the unit vh as being smaller than they should be.

You need to use a script that automatically resizes the container to get around this bug. Other than the inconvenience of loading a new script, some workarounds harm Chrome users.

Thank goodness CSS now supports new relative lengths and viewport specifications. A few of these are “vw”, “svw”, “lvw”, and “dvw”. These measurements are 1% of the width of the small, large, and dynamic viewport sizes and the UA-default viewport size.

Browser Support: 97.53%

8. Cascade Layers

If the next element in the cascade has a greater level of specificity, CSS overrides style changes to the first element. Due to the vast codebase, this problem is always present in large projects. Here CSS Cascade Layers come in.

Cascade Layers give developers better flexibility over themes, frameworks, and designs to utilize the cascading system fully. Cascade Layers provide direct manipulation and administration of the underlying cascade logic, in contrast to the original cascading centered around heuristics.

This CSS trend will ensure that the components won’t always adhere to the base styles by adding a second layer to the cascade to define style variants. Instead, components are produced in accordance with the rules written on the layer and the established hierarchy of the layers.

Browser Support: 87.57%

Our Gaming Platform Test Case Templates tutorial offers a step-by-step guide for effective test scenarios. Improve your game’s quality and performance today: https://www.lambdatest.com/learning-hub/gaming-platform-test-case-template

9. Content Visibility

Content Visibility property in CSS helps to speed up the rendering of content on the web page so users can interact with the content while the rest of the page is loading. With the help of this property, developers can command browsers which part of the page has isolated content. In return, it helps browsers to optimize web page content with delayed calculation.

Content Visibility is dependent on the CSS Containment Spec’s primitives. So far, only Chromium 85 supports content-visibility property; however, the CSS Containment Spec is supported on all major browsers.

Browser Support: 71.40%

10.Gap

Gap property is an emerging CSS trend that helps to define a gap between a row and a column, formally known as a grid gap. It serves as an alternative for the following characteristics.

  • Row-gap
  • Column-gap

We utilize the gap attribute with a single value to indicate the same space between rows and columns. If there is a difference in the distance between the rows and the columns, we utilize the gap function with two values, first defining the distance between the rows and then the columns. You can utilize two properties, row-gap, and column-gap, to make the code more transparent and understandable.

Before the gap property, the designer needs to use the margin property with certain limitations, such as adding an indent between the element and the edge of the container. In contrast, the gap attribute allows you to specify the indentation between items without using such hacks and gimmicks and instead merely relying on the language’s fundamental constructs.

Browser Support: 93.29%

CMS testing is required to ensure a content management system’s functionality, performance, security, and usability remain smooth:https://www.lambdatest.com/learning-hub/cms-test-case-template

11. Object View Box

Another CSS trend in our list is the object-view-box property. It enables a web page only to show the designated area of an image or video. It has a result that is roughly comparable to the viewBox SVG attribute. The object-view-box property will come in handy when you only show a piece of an image or video for distinct elements or at different resolutions. Additionally, it can be used to pan and zoom pictures and movies.

Before the object-view-box property, cropping problems with images or videos had to be solved by placing and resizing the content inside a wrapper element with the “overflow: hidden;” attribute. It can be done by adding the top, bottom, left, and right values within the code.

Browser Support: 66.99%

12.Inset

The Inset property helps to set the distance between the element and the parent element. It replaces the four properties: Top, Right, Left, and Bottom, and allows you to see the inset of the elements from all four sides in a single command. CSS Inset property requires adding all four commands for positioning.

Browser Support: 90.29%

A comprehensive end-to-end Testing tutorial that covers what E2E Testing is, its importance, benefits, and how to perform it with real-time examples: https://www.lambdatest.com/learning-hub/end-to-end-testing

13. Variable Fonts

Variable Fonts allow many variations of a typeface to be integrated into a single file Instead of having a separate font file for each width, weight, or style. It is an evolved version of the OpenType font specification.

Although Variable Fonts can be used just like regular ones, they have much more to offer. The font-weight property for standard fonts accepts values from 100 to 900, while for Variable Fonts, it accepts any integer between 1 and 999.

While the font-style property for regular fonts accepts two values for normal and italic, for variable fonts, you can specify an oblique angle ranging from -90 degrees to 90 degrees for variable fonts. Variable Fonts have a font-stretch feature that ranges from 50% (for narrow typefaces) to 200% (for broad typefaces), where the standard proportion is 100%. The font-optical-sizing attribute, which alters a font’s appearance based on size, is another.

Browser Support: 94.89%

14. Text Overflow

In CSS, the text-overflow property is used to indicate that specific text has overflowed and is now hidden. When you add this property, overflowed content will be trimmed, and a custom string or ellipsis will get visible on display.

One thing to keep in mind while using the text-overflow property is white space property must be nowrap and the overflow property set for hidden.

Browser Support: 98.95%

New Selenium IDE supports cross browser testing and parallel tests for automation along with record and replay function. Here’s why you shouldn’t miss out on it: https://www.lambdatest.com/blog/selenium-ide-what-is-it-why-is-it-must-for-every-qa/

15. Comparison Functions

Comparison functions are used to build a responsive website with fewer codes. It has functions such as “clamp(),” “min(),” and “max()” used to define upper- and lower-bound values, compute and compare the values of the inputs supplied to the function, and then apply the calculated value to the property.

  • clamp() function: This function requires three parameters: a central, preferred, and maximum value. clamp() compute the value of a property based on central value.
  • min() and max() function: The min() determines and applies the value from the range that is the smallest. Similarly, The max() function determines and applies the greatest value from the range of values given.

Browser Support: 92.26%

How to test CSS properties for browser compatibility?

As the CSS library is launching new features and properties, it brings new daily challenges for web developers to make website browsers compatible. It is essential to check that every CSS property you use for your website is working and supported in every browser.

Cloud-based cross browser testing platform like LambdaTest allows you to test your website and mobile apps and their associated CSS properties for cross browser compatibility on over 3000+ real browsers, devices, and OS.

 

With the LambdaTest platform, you can:

If you are keen to learn about different CSS properties, check out this CSS Cheat Sheet.

Automated Functional Testing tests helps to ensure that your web app works as it was intented to. Learn more about functional tests, and how automating them can give you a faster release cycle: https://www.lambdatest.com/blog/automated-functional-testing-what-it-is-how-it-helps/

 

Automated Functional Testing: What it is & How it Helps?

Automated Functional Testing tests helps to ensure that your web app works as it was intented to. Learn more about functional tests, and how automating them can give you a faster release cycle!

www.lambdatest.com

 

https://medium.com/@mehulgadhiya001/best-15-css-trends-to-watch-for-2023-f6f9a777458c

 

반응형
반응형

[HTML] 24 Powerful HTML Attributes Every Senior Web Engineer Should Master!

https://javascript.plainenglish.io/24-powerful-html-attributes-every-senior-web-engineer-should-master-ad8a4df0776e

 

24 Powerful HTML Attributes Every Senior Web Engineer Should Master!

There are many HTML attributes, in addition to some basic attributes, there are many useful and particularly powerful attributes;

javascript.plainenglish.io

There are many HTML attributes, in addition to some basic attributes, there are many useful and particularly powerful attributes;

This article will introduce 24 powerful HTML attributes that can make your website more dynamic and interactive, and make users feel more comfortable and happy.

Let’s explore these 24 powerful HTML attributes together!

1. Accept

The Accept attribute is used to specify a list of MIME types that the browser can handle.

Tips:

A MIME type is a standard for identifying the type of document,

For example, text/html represents an HTML document, image/jpeg represents a JPEG image, and so on.

By including the Accept attribute in the HTTP request header, the browser can tell the server which MIME types it can accept in response. Based on this information, the server can choose the most appropriate response type and return it to the browser. The value of the Accept attribute is a comma-separated list of MIME types, wildcards can be used to represent a class of MIME types, for example text/* represents all text types.

2. Autofocus

The Autofocus property is used to automatically set the focus to the specified element when the page loads.

Tips:

Autofocus attributes can be applied to various HTML elements such as text boxes, buttons, drop-down lists, and more.

In HTML5, the Autofocus attribute can omit the attribute value, indicating that the focus is set to the first element with the Autofocus attribute.

When the page is loaded, if there is an element with the Autofocus attribute, the browser will automatically focus the cursor on the element, so that the user can directly interact with the element without manually clicking or using the Tab key to switch focus.

3. Input mode

The Inputmode attribute is an attribute for specifying the type of content entered in the text box.

It can help the browser to better optimize the input experience, such as automatically popping up the appropriate virtual keyboard on mobile devices.

  • text: The default value, which means input any text.
  • none: indicates that no input is required.
  • tel: Indicates to enter a telephone number.
  • url: Indicates the input URL address.
  • email: Indicates to enter an email address.
  • numeric: Indicates the input number.
  • decimal: Indicates inputting a number with a decimal point.
  • search: Indicates to enter a search keyword.

The level of support for the Inputmode attribute may vary in different browsers.

Therefore, compatibility testing is required when using the Inputmode property.

4. Pattern

The Pattern attribute is a regular expression pattern used to specify the input content in the text box. It can help the browser to verify whether the content entered by the user conforms to the specified format requirements.

If the content entered by the user does not conform to the regular expression pattern specified by the Pattern attribute, the browser will display a default error message.

Tips:

  • The value of the Pattern attribute must be a valid regular expression.
  • The Pattern property can only be applied to elements that can enter text, such as text boxes, text fields, and password boxes.
  • The Pattern attribute will not prevent users from entering illegal characters, but will verify that the input content meets the specified format requirements when submitting the form.
  • The error message of the Pattern attribute can be customized using the title attribute.

The Pattern attribute is usually used together with the required attribute to ensure that the content entered by the user conforms to the specified format requirements and is not empty. For example, you can use the Pattern property to validate user input for zip codes, phone numbers, email addresses, and so on.

5. Required

The Required attribute is an attribute used to specify whether a form element is required.

If a form element has the Required attribute set, then when the form is submitted, if the value of the element is empty, the browser will prevent the form from being submitted and prompt the user to fill in the field.

Tips:

  • The Required attribute can only be applied to form elements, not to other HTML elements.
  • The Required attribute does not verify whether the content entered by the user meets the specified format requirements, only whether the element is empty.
  • The Required attribute does not prevent users from submitting spaces or whitespace characters, so some other means of validating user input is required.
  • The Required attribute can be used together with the Pattern attribute to verify that the user-entered content conforms to the specified format requirements.
  • The Required attribute can be used in conjunction with the Autofocus attribute to ensure that when the user enters the form page, the focus is automatically on the required field.

The Required attribute is often used with the type attribute of form elements, such as text boxes, drop-down lists, radio boxes, check boxes, and so on.

6. Autocomplete

The Autocomplete attribute is an attribute used to specify whether the form element has auto-complete enabled.

Autocomplete helps users fill out forms faster and reduces the chance of typing errors.

Tips:

  • on: The default value, which means that the auto-completion function is enabled.
  • off: Indicates that the auto-completion function is disabled.
  • name: Indicates that the name attribute of the form element is used as the keyword for automatic completion.
  • email: Indicates to use the most recent email address entered by the user as the autocomplete keyword.
  • username: Indicates that the user name recently entered by the user is used as the keyword for auto-completion.
  • current-password: Indicates that the password recently entered by the user is used as the keyword for auto-complete.
  • new-password: Indicates that the new password recently entered by the user is used as the keyword for auto-complete.
  • tel: Indicates to use the last phone number entered by the user as the keyword for autocomplete.
  • address-level1: Indicates that the country or region name recently entered by the user is used as the keyword for auto-completion.
  • address-level2: Indicates that the province or state name recently entered by the user is used as the keyword for auto-completion.
  • address-level3: Indicates that the city or region name recently entered by the user is used as the keyword for auto-completion.
  • address-level4: Indicates that the most recent street name entered by the user is used as the keyword for auto-completion.
  • country: Indicates that the country name recently entered by the user is used as the keyword for auto-complete.

The degree of support for the Autocomplete attribute may vary in different browsers. Therefore, compatibility testing is required when using the Autocomplete property.

7. Multiple

The Multiple attribute is an attribute used to specify whether a form element allows multiple selections.

The Multiple attribute is typically applied to form elements such as dropdown lists, file uploads, and checkboxes.

Tips:

  • The Multiple attribute can only be applied to form elements such as drop-down lists, file uploads, and check boxes, and cannot be applied to form elements such as radio boxes and text boxes.
  • The value of the Multiple property must be a Boolean value, true or false.
  • The default value of the Multiple attribute is false, which means that multiple selections are not allowed.
  • When the value of the Multiple attribute is true, the drop-down list will be displayed as a multi-selectable list box, the check box will be displayed as a multi-selectable check box list, and the file upload will allow the user to select multiple files.
  • When using the Multiple attribute, it is necessary to process the multi-selected values ​​in the background program, for example, use an array to store the multi-selected values.

If a form element has the Multiple attribute set, the user can select multiple options, not just a single one.

8. Download

The Download attribute is an attribute for specifying a file name when a link downloads a file.

If a link is set with the Download attribute, then when the user clicks the link to download the file, the browser will save the file locally and use the file name specified by the Download attribute to name the file.

Tips:

  • The value of the Download attribute can be any string, which represents the file name used when downloading the file.
  • The Download attribute can only be applied to tags, not to other HTML elements.
  • The Download attribute doesn’t change the actual name of the file, it just uses the specified filename when downloading.
  • The value of the Download attribute can be dynamically generated, for example using JavaScript to generate the filename.
  • When using the Download attribute, you need to ensure that the downloaded file is legal and does not violate the copyright and privacy of others.

The Download attribute is usually used in tags to download PDF, image, audio, video and other files.

9. Content editable

The Contenteditable attribute in HTML is an attribute used to specify whether an element is editable.

Tips:

  • The value of the Contenteditable attribute can be true, false or inherit.
  • The default value of the Contenteditable property is false, indicating that the element is not editable.
  • When the value of the Contenteditable property is true, the element is editable.
  • When the value of the Contenteditable attribute is inherit, the editability of the element is inherited from the parent element.
  • The Contenteditable attribute does not change the default behavior of the element, eg tags can still jump to other pages.
  • When using the Contenteditable attribute, you need to pay attention to security issues to avoid XSS attacks and malicious script injection.

If an element sets the Contenteditable attribute, then the user can enter text, insert pictures, modify styles, etc. in the element. The Contenteditable attribute is usually applied to, and other elements are used to implement functions such as rich text editors and editable tables.

10. Readonly

The Readonly attribute in HTML is an attribute used to specify whether a form element is read-only.

Tips:

  • The value of the Readonly attribute must be a Boolean value, true or false.
  • The default value of the Readonly attribute is false, indicating that the form element is editable.
  • When the value of the Readonly attribute is true, the form element is read-only.
  • The Readonly attribute does not prevent users from modifying the value of form elements via JavaScript.
  • The Readonly attribute is different from the Disabled attribute, which disables the form element so that it cannot submit data.
  • When using the Readonly attribute, it is necessary to process the read-only value in the background program, such as using a hidden field to store the read-only value.

If a form element has the Readonly attribute set, the user can see the value of the element, but cannot modify the value of the element. The Readonly attribute is usually applied to form elements such as text boxes, drop-down lists, and date pickers to display data or prevent users from modifying data.

11. Hidden

The Hidden attribute is an attribute used to specify whether an element is hidden.

Tips:

  • The value of the Hidden property must be a Boolean value, either true or false.
  • The default value of the Hidden property is false, indicating that the element is not hidden.
  • When the value of the Hidden property is true, the element is hidden.
  • The Hidden attribute is different from the display:none attribute of CSS. The display:none attribute will completely remove the element from the page, and the element cannot be accessed through JavaScript or other methods.
  • When using the Hidden attribute, the hidden value needs to be processed in the background program, such as using a hidden field to store the hidden value.

If an element has the Hidden attribute set, the element will not be displayed on the page, but it still exists on the page and can be accessed through JavaScript, etc. The Hidden attribute is usually applied to elements such as form elements, buttons, images, etc., to pass data or control page behavior without affecting the page layout.

12. Spellcheck

The Spellcheck attribute in HTML is an attribute used to specify whether to enable spell checking for an element.

Tips:

  • The value of the Spellcheck property must be a Boolean value, true or false.
  • The default value of the Spellcheck attribute is false, indicating that the element does not enable spell checking.
  • When the value of the Spellcheck attribute is true, the element enables spell checking.
  • The extent of support for the Spellcheck attribute varies by browser, and different browsers may have different spellcheck algorithms and dictionaries.
  • When using the Spellcheck attribute, you need to pay attention to security issues to avoid XSS attacks and malicious script injection.

If an element sets the Spellcheck attribute, then when the user enters text in the element, the browser will automatically check for spelling errors and display a red wavy line under the incorrect word. The Spellcheck attribute is usually applied to elements such as text boxes and text fields to improve the accuracy of user input.

13. Translate

The Translate attribute in HTML is an attribute used to specify whether an element should be translated.

Tips:

  • The value of the Translate attribute must be a Boolean value, yes or no.
  • The default value of the Translate property is yes, indicating that the element needs to be translated.
  • When the value of the Translate attribute is no, the element does not require translation.
  • The degree of support for the Translate property varies from browser to browser, and different browsers may have different translation algorithms and dictionaries.
  • When using the Translate attribute, you need to pay attention to security issues to avoid XSS attacks and malicious script injection.

If an element has the Translate attribute set, the browser will decide whether to translate the content of the element according to the value of the attribute. The Translate attribute is usually used in multilingual versions of websites to control which elements need to be translated and which elements do not.

14. Loading

The attribute in HTML loadingis a new attribute that can be used to specify the browser's priority when loading resources.

This attribute can be applied to tags such as <img>, <iframe>, <script>, <link>and <audio>.

Tips:

  • lazy: Indicates that the resource should be lazily loaded after the page loads. It's the default value.
  • eager: Indicates that the resource should be loaded immediately on page load.
  • auto: Indicates that the browser should decide when to load the resource by itself.

loadingAttributes are not supported by all browsers, so a compatibility check is required when using them.

15. Onerror

onerroris a JavaScript event handler that fires on JavaScript errors.

onerrorEvent handlers can be added windowto objects to catch JavaScript errors globally.

Tips:

  • message:wrong information.
  • source: The URL of the script where the error occurred.
  • lineno: The line number where the error occurred.
  • colno: The column number where the error occurred.
  • error: An Error object containing detailed information about the error.

onerrorEvent handlers can only catch JavaScript errors that are not caught by other error handlers.

It is best to use try-catch statements in your code to catch and handle JavaScript errors.

16. Poster

posteris an attribute of the HTML5 <video>tag that specifies an image to display before the video loads and before it plays.

Tips:

posterAttributes only apply to <video>tags, not <audio>labels.

It is commonly used to provide a preview image or thumbnail of a video.

17. Controls

controlsIs an attribute of the neutral tag in HTML5 <video>, <audio>which is used to specify whether to display the controls of the media player.

If controlsthe property is set to controls, controls are displayed on the media player, such as a play/pause button, volume control, progress bar, etc.

<!DOCTYPE html>
<html>
<head>
<title>Controls Example</title>
</head>
<body>
<video width="320" height="240" controls>
<source src="video.mp4" type="video/mp4">
<source src="video.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
</body>
</html>`

controlsAttributes are only available in browsers that support HTML5. If the browser does not support HTML5, the control will not be displayed.

18. Autoplay

autoplayis an attribute of the neutral tag in HTML5 <video>that <audio>specifies whether the media should play automatically on page load.

If autoplaythe property is set to autoplay, the media will play automatically on page load.

<!DOCTYPE html>
<html>
<head>
<title>Autoplay Example</title>
</head>
<body>
<video width="320" height="240" autoplay>
<source src="video.mp4" type="video/mp4">
<source src="video.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
</body>
</html>`

Autoplay can negatively impact the user experience, so use autoplayattributes with caution. In some cases, browsers may block autoplay, such as on mobile devices, where the user must first interact with the page to allow autoplay.

19. Loop

loopis an attribute of the <video>neutral <audio>tag in HTML5 that specifies whether the media should loop after playback ends.

If loopthe property is set to loop, the media will loop after playback finishes.

<!DOCTYPE html>
<html>
<head>
<title>Loop Example</title>
</head>
<body>
<video width="320" height="240" loop>
<source src="video.mp4" type="video/mp4">
<source src="video.ogg" type="video/ogg">
Your browser does not support the video tag.
</video>
</body>
</html>`

Looping can negatively impact the user experience, so use loopattributes with care.

20. Cite

citeis a global attribute in HTML that can be used to specify the source of the citation.

citeThe value of the attribute should be a URL pointing to the source of the reference.

Tips:

citeAttributes can be applied to tags such as <blockquote>, <q>, <del>, etc.<ins>

If the source of the referrer is not a URL, citethe value of the property can be set to a string describing the referrer.

<!DOCTYPE html>
<html>
<head>
<title>Cite Example</title>
</head>
<body>
<blockquote cite="https://www.example.com/quote">
This is a quote from an external source.
</blockquote>
<q cite="https://www.example.com/quote">
This is a short quote from an external source.
</q>
<del cite="https://www.example.com/deleted">
This text has been deleted from an external source.
</del>
<ins cite="https://www.example.com/inserted">
This text has been inserted from an external source.
</ins>
</body>
</html>

citeAttributes do not automatically create links, so if you need to create a link, you need to use <a>a tag and hrefset the attribute as citethe value of the attribute.

21. Datetime

datetimeIs an attribute of tags in HTML <time>, used to specify the date and time.

datetimeThe value of the attribute should be a valid date and time format, eg YYYY-MM-DDThh:mm:ss.

datetimeAttributes do not automatically format dates and times, so you need to use JavaScript or other tools to format dates and times.

22. Async

asyncis an attribute of the tag in HTML <script>that specifies whether the script should be loaded asynchronously.

If asyncthe property is set to async, the script will be loaded asynchronously and will not block parsing and rendering of the page.

Scripts loaded asynchronously may execute before the rest of the page loads, so use with caution. This can cause errors if the script depends on other parts of the page.

23. Defer

deferis an attribute of the tag in HTML <script>that specifies whether scripts should be lazy-loaded.

If deferthe property is set to defer, the script will delay loading until the page has been parsed before executing it.

<!DOCTYPE html>
<html>
<head>
<title>Defer Example</title>
<script defer src="script.js"></script>
</head>
<body>
<p>This is a paragraph.</p>
</body>
</html>

In the example above, we deferset the property to defer, which will cause the script to be lazy loaded. In this case the script will be executed after the page has been parsed and will not block the page from loading.

24. Draggable

Draggableis an attribute in HTML5 that allows users to move elements by dragging them. draggableWhen an element is set to , the user can drag the element with the mouse or by touching the screen. When dragging an element, a series of events will be triggered, such as dragstart, , dragand dragend, and these events can be used to implement the drag-and-drop function.

반응형
반응형

autofocus

문서가 로드되면 autofocus 속성이 들어간 input 태그에 자동으로 focus가 이뤄집니다.

  <form action="" method="">
    <input type="text" autofocus>
    <input type="text">
    <input type="text">
  </form>

 

required

회원가입을 할 때 필수항목을 입력하지 않으면 경고 문구가 뜨고 넘어가지 않죠? 원래는 스크립트로 구현해야 하는데 HTML로 쉽게 할 수 있는 방법이 바로 required 속성입니다.

input태그 모두 required속성을 주겠습니다.
그리고 한 칸을 비운채로 submit버튼을 누르면 어떻게 될까요?

  <form action="" method="">
    <input type="text" required>
    <input type="text" required>
    <input type="text" required>
    <button type="submit">다음</button>
  </form>

placeholder  

고객이 회원가입을 할 때 해당 입력창에 뭘 입력해야 하는지 힌트를 주는 속성이 바로 placeholder입니다.
물론 응용해서 회원가입 뿐만 아니라 다양한 용도로 사용할 수도 있겠죠?

  <form action="" method="">
    <input type="text" placeholder="아이디">
    <input type="password" placeholder="비밀번호">
  </form>

readonly  

입력은 받지 않고 읽기와 복사만 가능한 속성입니다.
어디에 사용하는지가 제일 중요하죠?

스크립트를 이용해서 특정 조건을 만족하면 활성화가 되게끔 합니다. 예를 들면 은행 대출을 받을 때 사전 설문조사로 특정 조건을 만족한 고객만 해당 입력창에 입력이 가능하도록 하는 것이죠.

  <form action="" method="">
    <input type="text" readonly value="조건 만족 전 입력 불가">
  </form>
반응형
반응형

웹폰트 사용하기


웹사이트의 주소를 복사하여 스타일 시트나 html의 ‘<link href~'로 연결-스타일 시트에서 font-family로 지정합니다.
② 직접 웹서버에 업로드하는 방법 : *.eot, *woff 로 변환 - 서버로 업로드 -
@font-face{
 font-family:글꼴이름;
 src:local('글꼴이름‘),
 url('글꼴이름.eot),
 url('글꼴이름.woff') format('woff'),
 url(‘글꼴이름.ttf') format('truetype);}

 

폰트 연결하기


1. font-family : 글꼴 속성지정


윈도우의 기본글꼴은

영문 : sans-serif, serif   

한글:굴림, 궁서, 돋움, 바탕

 

 


-css3 에서 웹폰트를 웹표준으로 설정하여 글꼴을 연결하여 사용하거나, 서버로부터 다운로드하여 스타일을 적용할 수 있습니다. 

 

 

구글 폰트 다운로드 사이트


http://fonts.google.com
http://fonts.google.com/earlyaccess

 

Google Fonts

Making the web more beautiful, fast, and open through great typography

fonts.google.com

직접 폰트 변환하여 연결하기

 

변환 사이트

https://onlinefontconverter.com/웹폰트를 변환한 후, 변환된 폰트 파일들을 fonts라는 폴더를 생성하여 넣어 주고 html에 연결하여 사용하면 됩니다.

웹폰트의 확장자에는 otf, eot, svg, ttf, woff, woff2 등이 있습니다.

 

웹에서 사용 가능한 폰트 : woff, 트루타입(ttf), 오픈타입(ttf, otf), 임베디드 오픈타입(eot), svg폰트(svg, svgz)

컴퓨터에서 사용하는 글꼴은 ‘*.ttf’이지만,다른 확장자들에 비해 용량이 크다는 단점이 있어 웹코딩을 할때에는 ‘*.eot', '*.woff'이 가장 적합합니다.

 

---> 대부분의 모던 브라우저에서 지원하는 woff 글꼴 파일을 먼저 선언하고 ttf파일은 그 다음에 선언한다.(ttf가 용량이 크기 때문에) woff파일의 형식을 지원하는 브라우저는 woff를 다운로드 하고 굳이 ttf는 따로 다운로드 하지 않습니다.

 

외부 스타일 css파일로 연결할 경우

<link href="css파일경로" rel="stylesheet" type="text/css">

 

html파일의 <head>부분에 외부 스타일 link을 연결해 놓고

css파일에는 다음과 같이 입력합니다.

@font-face{

font-family :‘글꼴이름‘;

src : local('글꼴명‘),

url('경로명/글꼴이름‘) format(’파일유형‘),

url('경로명/글꼴이름‘) format(’파일유형‘),

url('경로명/글꼴이름‘) format(’파일유형‘),

url('경로명/글꼴이름‘) format(’파일유형‘);

 

@font-face{

font-family :‘NanumPenScript-Regular‘;

src : local('NanumPenScript-Regular‘),

url('./fonts/NanumPenScript-Regular.eot‘),

url('./fonts/NanumPenScript-Regular.woff‘) format(’woff‘),

url('./fonts/NanumPenScript-Regular.ttf‘) format(’truetype‘),

url('./fonts/NanumPenScript-Regular.otff‘) format(’opentype‘);

}

 

폰트를 문서 전체( body)에 적용할 경우

body{font-family:'NanumPenScript-Regular‘,’serif','sans-serif'}

 

반응형

+ Recent posts