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.

Alternative Style rule for positioning an element?

Featured Replies

I'm currrently coding my first site: [blog=leonfassbender.com][/blog]

 

If you go to that site you'll see my simple and modest logo on the left top of the page...

 

I positioned that logo by using the below style rules:

 

#p1 {

font-family: arial; Times; Verdana;

font-size: 60px;

color: white;

padding-top: 10px;

padding-left: 50px;

padding-bottom: 50px;

}

 

Basically I want to have that logo positioned some 20 px to the right of the left margin but exactly centered in the middle of the gray area...

 

Thanks fr yr help,

 

Cheers

 

As you can see I played around a bit with the style rules. Is there a better/ easier way to achieve this?

 

Thanks

try

 

#p1 {
width: auto;
font-family: arial; Times; Verdana;
font-size: 60px;
color: white;
margin: 0 auto; /*adds an auto margin to left and right to center the element*/
}

  • Author

Thanks guys!! Well, I tried something else that worked perfectly: I used the "position" element, allowing me to precisely position my p1 <DIV>. (not uploaded yet).

 

#p1 {

font-family: arial; Times; Verdana;

font-size: 60px;

color: white;

position: absolute;

top: -30px;

left: 20px;

right:0px;

bottom:0px;

}

The only problem with using absolute positioning, is that it could disfigure your site when viewed in different screen sizes, browssers and resolutions. My website i am doing now (my first also) i used everything inline styles and used position:absolute divs and found that it would only look right on the computer that i built it, so had to re code it all lol.. but yeah, i would test it on different screen sizes and browsers just to make sure its what you want it to look like.

  • Author

Thanks Beer Huntor, yeah I will need to check that and change if necessary.....

 

Curious to see your site now....:-)

 

cheers

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.