Welcome to Code Forum!

Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.

    GIF shows where to locate </> in the thread and or post editor toolbar.
    To learn more about how to use our BBCode feature, review our "How to post your code into threads" here.

    Thank you, Code Forum.

Adding a hyperlink to HTML Code

Attn HTML Experts

Can anyone care to modify the HTML code below to incorporate a hyperlink "#" so that when clicked, it opens a webpage page on the same tab ?

HTML:
<p class="color-white text-center" style="letter-spacing: 0.1em; font-weight: bold; display: block; line-height: 1.5; padding: 5px 0; margin-bottom: 0;">INTRODUCING OUR NEW BONNA COLLECTION: BLUE WAVE, MESOPOTAMIA &amp; SWAY COLLECTION - MADE by <span class="nasa-underline">Bonna Premium Porcelain</span></p>

Webpage image banner

Screenshot_130.webp

The hyperlink should be linked to the text "Bonna Premium Porcelain".

The hyperlink "#" will be replaced by the relevant webpage link.

Thanks in Advance.
 
Last edited:
Solution
It seems strange that it wouldn't allow you to directly change the colour without even using CSS.

If you can add attributes, try adding something like style="color: white;"
This worked:

Code:
<p class="color-white text-center" style="letter-spacing: 0.1em; font-weight: bold; display: block; line-height: 1.5; padding: 5px 0; margin-bottom: 0">
    INTRODUCING OUR NEW BONNA COLLECTION: BLUE WAVE, MESOPOTAMIA &amp; SWAY COLLECTION - MADE by <span class="nasa-underline"><a style="color: white;" href="#">Bonna Premium Porcelain</a></span>
</p>

Thanks.
Hi @maverick99,

Welcome to Code Forum! So my understanding is that you want to make Bonna Premium Porclain as hyperlink. You can do this by wrapping the phrase within an anchor tag <a>. The code would look something like this:

HTML:
<p class="color-white text-center" style="letter-spacing: 0.1em; font-weight: bold; display: block; line-height: 1.5; padding: 5px 0; margin-bottom: 0">
    INTRODUCING OUR NEW BONNA COLLECTION: BLUE WAVE, MESOPOTAMIA &amp; SWAY COLLECTION - MADE by <span class="nasa-underline"><a href="#">Bonna Premium Porcelain</a></span>
</p>
 
Hi @maverick99,

Welcome to Code Forum! So my understanding is that you want to make Bonna Premium Porclain as hyperlink. You can do this by wrapping the phrase within an anchor tag <a>. The code would look something like this:

HTML:
<p class="color-white text-center" style="letter-spacing: 0.1em; font-weight: bold; display: block; line-height: 1.5; padding: 5px 0; margin-bottom: 0">
    INTRODUCING OUR NEW BONNA COLLECTION: BLUE WAVE, MESOPOTAMIA &amp; SWAY COLLECTION - MADE by <span class="nasa-underline"><a href="#">Bonna Premium Porcelain</a></span>
</p>
As simple as that !

Thanks for sharing the code, however, can we improve the aesthetics ?

On page load up screenshot

Screenshot_131.webp

On mouse hover screenshot

Screenshot_133.webp

Can you modify the code so that the text 'Bonna Premium Porcelain' is displayed in white color ? On mouse hover, it should also display in white colour.

Rgds
 
As simple as that !

Thanks for sharing the code, however, can we improve the aesthetics ?

On page load up screenshot

View attachment 2978

On mouse hover screenshot

View attachment 2979

Can you modify the code so that the text 'Bonna Premium Porcelain' is displayed in white color ? On mouse hover, it should also display in white colour.

Rgds
Hey there,
So this is done with CSS. In the head of your HTML document, add a style element and then select the hyperlink. This can be done by giving the like an id (id="id-name") and then selecting it in the CSS with #id-name. After selecting the element you can give it a colour with the color property.

It should look something like this:
HTML:
<style>
#hyperlink {
  color: white;
}

#hyperlink:hover {
  color: white;
}
</style>
 
Hey there,
So this is done with CSS. In the head of your HTML document, add a style element and then select the hyperlink. This can be done by giving the like an id (id="id-name") and then selecting it in the CSS with #id-name. After selecting the element you can give it a colour with the color property.

It should look something like this:
HTML:
<style>
#hyperlink {
  color: white;
}

#hyperlink:hover {
  color: white;
}
</style>
How do I incorporate this into the Elementor section ?

The banner is designed with Elementor page builder.

Screenshot_1.webp
 
It seems strange that it wouldn't allow you to directly change the colour without even using CSS.

If you can add attributes, try adding something like style="color: white;"
 
It seems strange that it wouldn't allow you to directly change the colour without even using CSS.

If you can add attributes, try adding something like style="color: white;"
This worked:

Code:
<p class="color-white text-center" style="letter-spacing: 0.1em; font-weight: bold; display: block; line-height: 1.5; padding: 5px 0; margin-bottom: 0">
    INTRODUCING OUR NEW BONNA COLLECTION: BLUE WAVE, MESOPOTAMIA &amp; SWAY COLLECTION - MADE by <span class="nasa-underline"><a style="color: white;" href="#">Bonna Premium Porcelain</a></span>
</p>

Thanks.
 
Solution
Back
Top Bottom