Styling your list-items just got so much easier with this ::marker

Styling your list-items just got so much easier with this ::marker

Kevin Powell

3 года назад

70,720 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@KevinPowell
@KevinPowell - 06.04.2021 16:24

Any time I say pseudo-element in this video, I mean ::before and ::after. As the title of the video says, ::marker is a pseudo-element. I'm just so used to saying it to only refer to before and after, and I didn't realize it until I was editing. Sorry about that!

Ответить
@sandrapitzke546
@sandrapitzke546 - 07.10.2023 21:26

I really love the way you CSS !!!

Ответить
@amanuelelhanan4716
@amanuelelhanan4716 - 22.09.2023 16:42

To center icons center and nice fit with li element I still prefer to add span inside li element and make li display: flex and align-items: center;

Ответить
@donmakaveli2227
@donmakaveli2227 - 17.06.2023 00:16

Doesn't list-style do the same job? I always found custom icons on lists to be easy to implement.

Ответить
@romeojoseph766
@romeojoseph766 - 15.06.2023 07:50

Sir,

Where do you get the latest update on web development

Ответить
@Javascript_lover
@Javascript_lover - 23.03.2023 09:41

thanks sir You solve my issue
You are awesome teacher
I love they way you guide us

Ответить
@nevinsronald8728
@nevinsronald8728 - 28.10.2022 11:23

😃🤩

Ответить
@agussander5829
@agussander5829 - 27.09.2022 11:06

Does somebody know how to make "content" changes work on mobile chrome?

Ответить
@lordrobertoguirand7789
@lordrobertoguirand7789 - 12.06.2022 01:13

thanks
for this video, but i have a problem, not all unicode icon work for me. In my case i see only the plus icon unicode work, but others no.

Ответить
@dogomeow4067
@dogomeow4067 - 10.06.2022 01:48

Hey! Does anyone knows how we can change it's size?

Ответить
@patrickh9810
@patrickh9810 - 05.04.2022 17:04

Just curious, is it possible to change only the second marker and leave the rest as a bullet?

Ответить
@toderox
@toderox - 24.03.2022 09:55

Pure Gold , as usually!

Ответить
@chubbyBunny94
@chubbyBunny94 - 02.02.2022 12:51

ol's are a whole other story

Ответить
@chome4
@chome4 - 22.01.2022 18:58

How do you adjust the spacing between items? Line height doesn't do work as it messes with items that cover more than one line.

Ответить
@utsavsharma2979
@utsavsharma2979 - 19.01.2022 21:02

It's a long time since I learned something delightingly new in css

Ответить
@adrianpabloalvarez2523
@adrianpabloalvarez2523 - 18.10.2021 08:47

I see the icon as a small square. Can't see it. If I copy de code I just see the text of the code. In some moment font awesome changed and starting requiring a code for a kit that is received in your email account. I remember needing to declare it in the head of html fight

Ответить
@simonerocutto6461
@simonerocutto6461 - 30.09.2021 20:40

hohoho

Ответить
@dillpickleMMO
@dillpickleMMO - 24.09.2021 05:39

Thanks!

Ответить
@Jxerot
@Jxerot - 18.09.2021 23:54

this, is, awesome. ::marker is the new king of lists!

Ответить
@jjjrmy
@jjjrmy - 13.09.2021 18:13

Does this not work on Safari for Font Awesome icons?

Ответить
@nemethricsi
@nemethricsi - 07.09.2021 21:12

Love your videos Kevin! <3 can you tell me what font-family are you using in Codepen?
And also: how can you add an svg to content property? 🤔
Thank you! 🙏🏻

Ответить
@jdeso3
@jdeso3 - 02.09.2021 21:46

Can the marker be moved up and down to better lineup with the text if needed.

Ответить
@hashimnaushahi
@hashimnaushahi - 30.08.2021 09:58

Hi Kevin,

I just discovered your channel yesterday and I've been binge watching your videos. It's amazing how much I was able to learn in such a short amount of time thanks to the way you explain and show things. Thank you for creating and sharing these videos!

I'd like to ask you something about the ::marker element. Is there a way to use it for unordered lists so that the markers are aligned with the rest of the content and the texts of the list items stay aligned even when those texts continue on a second line?

I love your elegant solutions and I'm looking forward to your solution for this. Thank you in advance! :)

Ответить
@acidhauss7018
@acidhauss7018 - 05.08.2021 19:53

Excellent video. I have 1 question. Say I have a long string of text that wraps onto another line, is there a way to align the marker with the text.

e.g.

//Unwanted behaviour

* verylongtext onto new lines
keep on going and going and going
and going and going

//Desired behaviour


verylongtext onto new lines
* keep on going and going and going
and going and going

I believe this is not possible due to the way pseudo elements work

Ответить
@sarahloufisher
@sarahloufisher - 05.07.2021 23:44

As someone who designs cruise websites, believe me when I say, we would use anchor bullet points 😂

Ответить
@karlbesley4332
@karlbesley4332 - 01.07.2021 12:54

you sir are a legend!

Ответить
@wolframzell6162
@wolframzell6162 - 28.06.2021 16:37

I would really like to see a video along the lines of "Things we used to do with JS, now available to CSS."

Ответить
@kamruzzamankamran3233
@kamruzzamankamran3233 - 28.06.2021 12:31

Hey Kevin, you are my all time favourite.
A small question here;
If I am using the font-awesome npm package, do I have to set the font-family to font-awesome, in case to use any FA content like you showed !!!

Ответить
@Rocadamis
@Rocadamis - 23.06.2021 14:55

You can just add a SPACE after the icon code in the CONTENT element. All the extra coding to do something as simple as add some space after a bullet icon is totally unnecessary. Why use padding or margin when a simple space will do?

Ответить
@MegamanXGold
@MegamanXGold - 22.06.2021 21:55

If you're using Font-Awesome for the bullets, are the contents of the ::marker automatically aria-hidden? You mention you can use SVGs but promote Font-awesome. Shouldn't people avoid Font-awesome because of the accessibility issues?

Ответить
@seanfizzwebdesign
@seanfizzwebdesign - 21.05.2021 17:26

Great stuff as always - though sadly Safari (14.0.3) does not seem to support the 'content' attribute while using 'marker'.

Ответить
@ramraut
@ramraut - 19.05.2021 00:12

How do we access the content of the ::marker. The getComputedValue() works on ::before and ::after but not on markers.

Ответить
@MichalKall
@MichalKall - 14.05.2021 15:31

Great Job buddy !
You channel has become my daily inspiration.

Using what I learn professionally as much as on personal projects!
love it,
Keep up the great work !

Ответить
@alexradu1921
@alexradu1921 - 14.05.2021 00:35

How can I set display:none to a ::marker? :(, because a theme in wordpress hard-coded marker to each list, and I can't remove it with list-style: none; ... and I also can't use display: none; to these ::marker pseudo-elements..

Ответить
@RoiTrigerman
@RoiTrigerman - 10.05.2021 20:16

Great video! For the li padding, you could use: padding-inline-start: 0.5em; to support rtl also.

Ответить
@sagnickbhowmick6191
@sagnickbhowmick6191 - 08.05.2021 22:19

Man, u looking handsome! 👊😂

Ответить
@benzflynn
@benzflynn - 06.05.2021 16:29

But margin-right and padding-right do not produce any effect on the ::marker pseudo element's position relative to its parent . . .

Ответить
@crooker2
@crooker2 - 06.05.2021 07:55

THIS I did not know. Thanks Kevin!

Ответить
@perrymitchell7118
@perrymitchell7118 - 01.05.2021 14:20

Thanks again man. <3

Ответить
@gigalicious
@gigalicious - 27.04.2021 06:49

Safari doesn't support the content style on ::marker which, to me, is the most important one.

Ответить
@paulh6933
@paulh6933 - 25.04.2021 22:13

How would use content to refer to my own svgs?

Ответить
@williamsimpson2303
@williamsimpson2303 - 25.04.2021 14:40

I like the fact that you videos are short and to the point. I hate sitting through long presentations for the one thing I want to learn. I end up just bailing and looking it up on stack overflow or something similar. With your presentations I don't have that issue. I look for the video that covers what I want to learn and you are very thorough, but very concise. Great job.

Ответить
@skyletwings5711
@skyletwings5711 - 23.04.2021 07:56

Not “marker“, changed everything, “Kevin“ did! Thank you so much, dude!

Ответить
@casperdewith
@casperdewith - 21.04.2021 17:47

Nice tutorial, but I wouldn’t endorse using icon fonts. They are not always friendly to screen readers, especially outside of pseudo-elements, and they needlessly take up a lot of space. SVG = 🎉

Ответить
@ts8960
@ts8960 - 20.04.2021 19:56

isn't this exactly the same as ::before? what are the advantages

Ответить
@AycanOgut
@AycanOgut - 20.04.2021 00:20

thank you for the great content, again and again!

Ответить
@codyshaner3258
@codyshaner3258 - 19.04.2021 18:10

Solid vid's, really appreciate your channel. Thanks again!

Ответить