how to remove gap of text align end.
i'm trying to align text center and when i do with full width of that heading i see that text has some padding or margin to the end but all the elements that are related to h1 in hero section has margin and padding 0 but it has some gap and when i align text to start it doesn't have gap and when i align text to end or center it has a gap how can i solve it ?
i'm working on this project after 5 to 6 days i think so i'm kind of lost already like where is what from html to css so i apologize for that.
34 Replies
From looking at this it seems like the h1 element is wider than its parent and overflow is being hidden
how can i see it ?
there is no 'overflow: hidden'
for any element
I could be entirely wrong. What happens if it's aligned right? β is the second word cut off? πΆβπ«οΈ
no. when it is aligned right it's the same you can see in the picture that you modified
have you tried to justify the text?
in your case, you could use an svg with the text element
Are you using letter-spacing? That will add the space behind the last letter as well.
you could counter it by adding a margin-left of the same amount on the first letter
that's not my problem
my problem is i want that end of the letter to not have letter spacing so it can touch width
if this make sense
it would really help if you could share your code.
as you can see i want that J and C to align
i don't have words to describe it
but lemme show sample
sample
That doesn't really reflect the images that you have added here as the "CEO & PRODUCT DESIGNER" text is in no way aligned with the "JON MOON" text so it is not clear what you want to align with what.
As a side note, I realize that this may just be due to you creating a quick codepen but bear in mind that you should only have one <h1> tag on each page.
it's a mobile first css
yes
should i change it ?
i want that jon text to be responsive and it should get big as width get's bigger
i mean screen size
Unless I have missed something, until now you haven't mentioned anything about it being "responsive" or "getting bigger" (not sure if you are referring to the text size, the spacing or the width??)
Firstly you said that it should be centered (and that wasn't working as can be seen in your screen captures), then you said that you wanted the J and C to align...
I'm afraid that I am struggling to understand what it is that you wish to achieve and what issues you are having π .
You also have some strange CSS going on, eg:
It looks like you are attempting to nest an h1 within .logo-big but in the HTML, the h1 is the element with the class "logo-big".... so this nested element in the CSS does not exist.
i'm not gonna lie i'm lost with words this time kinda confused how should i put it in words.
i want it to increase by size so i don't have to put size manually on every media query.
also it should align to margin i mean if i'm giving margin of 2em then text should start and end to that margin.
the images i showed they're for mobile cause i'm working from mobile to desktop.
actually design and developing was done but i didn't like the home page design so i changed it.
ahh i'm using scss
kinda got habit of that from the first day
also it should align to margin i mean if i'm giving margin of 2em then text should start and end to that margin.So, as I understand it you want the text "JON MON" to extent all the way from left to right of it's parent container (hero-one) and get larger (presumably you are referring to the font size) as the viewport increase in size. Is that correct? if so, as Epic has already suggested, your best bet is probably going to be an SVG. Something like this:
ok that's something i can work with
what bout this ?
check my codepen @Chris i put last N in span and removed it's letter spacing and the ceo and product designer should be align start at mobile and when width increases it should goto center.
check the current situation and let me know if i should switch to svg
let me share desktop design
You should really go with what works for your situation and needs. Very rarely is there only one solution to the same problem. And each solution may have its pros and its cons.
Your solution seems to work well on most viewport sizes and may only need some tweaking (or not if that is how you want it) on smaller viewport widths where it breaks down onto 2 lines (this is happening at 428px on both Firefox and Chrome on my computer)
yes i'm also facing that issue. i'm using that SVG solution and it looks good but i have to understand that viewbox and x and y what is that for and how can i properly use it.
let me do a google search and if it didn't work i'll ping you
@Chris check this out
you can use the text element to set a max width, and the text will shrink in width to fit it
it wont change in height, but it's something
however, you can tell the svg to keep a specific proportion with
aspect-ratio
or using the preserveAspectRatio
propertycan you show me this in codepen, so i know what exactly what you mean.
You would just add that to the SVG code that I showed you before.
Here is my codepen version that I used to create the screen-capture that I showed you: https://codepen.io/cbolson/pen/VwoOVjr
you can also put it inside the h1, and it is valid
why can't
.line
accepting flex-grow: 0.8;
?
i had to give width manuallyThis question doesn't look like it is related to the topic of the original post.
If you have a new question you should open a separate post.
i thought opening a new post will be too much so i didn't open it
and i thought bout svg and all but i want to do it perfectly so let me do other stuff of the website then i will see what to do with that logo in the end
perfection is impossible
haha yes it is π
alright i'm done with bottom design let's manage hero section.
i'm too confused now what to do