Friday, July 1, 2022
HomeFun With ProgrammingHow to center a fieldset in HTML using CSS?

How to center a fieldset in HTML using CSS?

For that you have to position the element absolutely, offsetting the div by 40% or 50% from the left and if you want to center vertically than the top part also offeset by 50% else offset it by ur requirements of the window and move the div to the left and to the top with half its width and height with a negative margin, to have it perfectly centered.

and this is the CSS code:

    position:absolute;
    left:40%;
    top:20%;
    margin:-100px 0 0 -150px;

More Question Answered:–

Previous articleSales v/s Marketing
Next articleCV VS RESUME
Rahul K Rajhttps://rkrknowledge.com/
Hi 👋, I'm Rahul Raj Kushwaha also known as Rahul K Raj. A passionate full-Stack developer from India. You can call me: Entrepreneur | Youtuber | Blogger | Coder | Developer | UI Designer | Hacker | Music Composer. I like to share my knowledge on such great platforms like RKR Knowledge. I try to learn something new every day.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

- Advertisment -

Stay Connected

24FansLike
25FollowersFollow
475SubscribersSubscribe

Most Popular

Recent Comments