Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need help achieving this line in css

Featured Replies

Hey all, I'm somewhat of a newby to the web design world and I have a question that I couldn't figure out how to word for google. Basically I want this line (like in the portfolio, skills, and contact heading in this site... http://www.jorgenmortensen.eu/) to be on both sides of my h2 tags on my site. I'm pretty sure it's something in css to accomplish this but i wasn't sure what. Any help is appreciated!

 

Zac

Hey all, I'm somewhat of a newby to the web design world and I have a question that I couldn't figure out how to word for google. Basically I want this line (like in the portfolio, skills, and contact heading in this site... http://www.jorgenmortensen.eu/) to be on both sides of my h2 tags on my site. I'm pretty sure it's something in css to accomplish this but i wasn't sure what. Any help is appreciated!

 

Zac

 

Could you be a little more specific as to what it is you're trying to achieve? What do you mean by the "line"? Do you mean the diagonal sloping lines in the background of the portfolio, skills, and contact heading? Or this: http://www.jorgenmortensen.eu/images/bg-logo-footer.png Also, when you say that you want this placed on both sides of h2 tags on your site, do you mean that you want it to cover the background of your h2 tags, to be on the top/bottom left/right? I'm confused!

I'm not sure what you mean either, but try this and see if either of teh h2 tags is what you want.

<!DOCTYPE>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Test</title>

<style type="text/css">
h2 { width: 700px; height; 40px; background: url(bg-menu.png); text-align: center; }
h2 span.text1 { display: inline-block; background: #fff; margin: 0 50px; width: 130px; height: 40px; }
</style>

</head>
<body>

<h2>Skills</h2>

<h2><span class="text1">Skills</span><span class="text1">Contact</span></h2>

</body>
</html>

 

It centers the words inside the h2 tag, the first has the word over the diagonal background, the second has the words on white background with the diagonal image at the sides of the words.

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.