Home › Forums › Archived Forums › Weaver II Theme › Weaver II Pro › Make text in header clickable
- This topic has 14 replies, 2 voices, and was last updated 10 years, 9 months ago by
scrambler.
-
AuthorPosts
-
November 25, 2015 at 11:25 UTC - Views: 6 #18364
RichieP
ParticipantHi there
I need to make the phone number and email address clickable, rather than part of the image.
Is there a way to overlay text on the header or add a sort of transparent text box?
http://www.claregatedental.co.uk/
Thanks
RichieNovember 25, 2015 at 17:02 UTC - Views: 14 #25045scrambler
ModeratorThere are many different ways to do that, the issue is what will be the responsive behavior, which means what happens when the browser becomes smaller.
By using a global image, the whole image scales down with the browser.
If you use text for the phone and email, they wont be able to scale down, so you will need to make them smaller or else they will end up over the logo on the left.
Given what you have right now, I would start by trying to use the Header widget area. Define two widgets in there (Main options > Header > Header widget area) with width percentages of 40% and 60%.
Then go in appearance > Widgets, drop two text widgets in the header widget area, place the HTML of the logo image only in the fisrt one, and put your phone number and email as links in the second one.
Then we can fine tune what happens on mobile.
If you really wanted to keep the phone number and email that big, you could eventually make one image for each, and insert these two images in the second text widget as links. To allow the images to scale, you would add a max-width:100% in a style attribute of the image tag
<a href=”linkurl”><img style=”max-width:100%;” src=”phone-imageurl” /></a>
<a href=”linkurl”><img style=”max-width:100%;” src=”email-imageurl” /></a>
November 25, 2015 at 17:43 UTC - Views: 6 #25046RichieP
ParticipantThanks for your quick reply.
I thought it might be using the widgets. I’ve made some progress but don’t know how to increase the size of the text, make it white and have them on different lines.
Richie
November 25, 2015 at 18:09 UTC - Views: 5 #25047scrambler
Moderatoryou can style text with inline CSS and create a line break with <br/> like below
<span style=”font-size:150%;”>Tel: 01902 754525</span><br/>
<span style=”font-size:150%;”>Email:[email protected]</span>If you are not familiar with basic html, you can use the content editor of a test page to do your formatting, then switch the content editor to text mode and copy the HTML from there
November 25, 2015 at 21:47 UTC - Views: 5 #25048RichieP
ParticipantThanks. Much better now.
The phone number kept coming out larger for some reason so I’ve set the font size in the Header options.
Is there a way to change the font to white?
Thanks
November 25, 2015 at 22:07 UTC - Views: 5 #25049scrambler
ModeratorAdd any extra styling to the style attribute of the text
<span style=”color:white;font-size:120%;”>Tel: 01902 754525</span><br/>
<span style=”color:white;font-size:150%;”>Email:[email protected]</span>November 25, 2015 at 22:19 UTC - Views: 5 #25050RichieP
ParticipantIt displays white when I copy and paste your code, but when I add the a href to make the text clickable it goes back to blue.
November 25, 2015 at 23:00 UTC - Views: 6 #25051scrambler
ModeratorYes, because links are styled differently.
To style the link colors differently in the header widget area, use the rules below placed in Advanced Options > Head section > Custom CSS Rule box
#sidebar_header a {color:white;}
#sidebar_header a:hover {color:red;}November 26, 2015 at 14:21 UTC - Views: 5 #25052RichieP
ParticipantExcellent. Thanks for your help.
Richie
November 26, 2015 at 22:08 UTC - Views: 8 #25053RichieP
ParticipantHi there
Sorry to be a pain but I don’t want to start a new thread as this relates to the same thing.
I’ve made the font in the header large so it fills most of the space. However, this doesn’t scale down for a mobile device. The text flows onto the next line on my phone and the whole header area looks huge.
How can I get the text to scale down the same way an image does?
thanks
RichieNovember 27, 2015 at 04:25 UTC - Views: 12 #25054scrambler
ModeratorIf you read my initial post, I warned you that you cannot have the text scale, it is just not possible with CSS.
You only have two solutions.
Put a class on the links and use an @media rule to change the text size under a certain width. The text will be one size above a certain browser width, and another size under that, no progressive scaling
Or create one image for the phone number and one image for the email, like I explained in my first answer, and these will scale with the browser
November 27, 2015 at 11:47 UTC - Views: 5 #25055RichieP
ParticipantThanks for your reply.
I realise you said that now. Going back to images again puts it back to the original issue. How can I apply the @media rule to the text in the header?
Thnaks
RichieNovember 27, 2015 at 17:57 UTC - Views: 10 #25056scrambler
Moderator“Going back to images again puts it back to the original issue”
No, you did not understand what I meant, you would not create one large header image, but two small images one with the Phone number, and one with the email. These two images would be in the same place you have the text right now in the right widgets, and they could scale with the widget.
to use an @ media rule to change the text size you would do the following.
Add a class to the span that has the font-size style, and remove the inline style.
<span class=”mytext“>
<a href….>Email</a>
<a href….>phone</a>
</span>Then you would place the rules below in Advanced Options > Head Section > Custom CSS Rule box.
.mytext {font-size:300%;}
@media only screen and (max-width:640px) {
.mytext {font-size:200%;}
}using the value you want for the width threshold and the size
December 3, 2015 at 14:18 UTC - Views: 6 #25057RichieP
ParticipantSorry for delayed reply. I’ve not had the chance to revisit this.
I probably didn’t word the reply very well – “Going back to images again puts it back to the original issue”
I understand about making smaller images, but will these work as clickable links to the email or phone number?
Thanks
RichieDecember 3, 2015 at 17:39 UTC - Views: 5 #25058scrambler
Moderatoryou can make an image a link. see base principle below
<a href=”link“> <img style=”max-width:100%;” src=”imageurl ” /> </a>
-
AuthorPosts
- The forum ‘ Weaver II Pro’ is closed to new topics and replies.

