So, I’m looking to do a single H1 tag to go around a container. If I use CSS rotate, I can rotate the text, but obviously only the 90 degrees, not around a div. I’m looking to keep the text in ONE H1 tag since the designer would like this to be the headline of the page and for SEO purposes.
I’m not sure if this is possible from all the research I’ve done. I’m a bit stumped. I figured you guys/gals would know if this would be even possible.
<h1>Latest News</h1>
<div>Blue Square</div>
4
Answers
What you are looking for are
svg
elements. This is an entire different world of coding, but works as HTML. I would suggest to follow some documentation about svg. CSS is not meant for these types of manipulation.I have create an example: svg fiddle
HTML
To follow text around a rectangular you need to use
<path>
and<textPath>
.relative
(with somemargin
room for the offset heading text)absolute
with negative top-1.1em
<span>
(inside the heading) for the rotated vertical text100% + 1.1em
transform
rotate you SPAN on the originright top
by-90deg
Wrap into
<span>
automatically (server-side)If you’re pulling unknown length titles i.e. from a CMS, I suggest you split your string in half- word-aware! in order to determine the first-half word/s that need to be wrapped in
span
Example using PHP:
PHP – use like:
Will result in:
JavaScript – Use like
The above demos are adapted from this JavaScript example
It can be done by simple CSS transforms:
The h1 will be treated as “HEAD ONE” text by search engines.
i think this way can help you
but your uploaded image not loaded, please try again upload it , and reply to me to I help you