473,748 Members | 6,418 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Can't achive the same margins for <a> and (inline) <p> in CSS

I'm creating a common navigation bar of text "buttons" using CSS. On each
page, I want the corresponding button to be "inert" (no hover, etc) as a
visual clue to where you are.

I thought I'd include simple <p> tags, and style them the same way as the
<a> tags, but I can't get it to work - I get different margins in each case.

I've reduced the situation to the essentials here:
http://philipherlihy.members.beeb.net/CssMargins/

Is there a fix, or am I swimming against the current? Suggestions very
welcome - it's driving me mad!

--
############### #####
## PH, London
############### #####
Jul 20 '05 #1
33 2530
On Sun, 19 Sep 2004 15:19:12 +0000 (UTC), "Philip Herlihy"
<fo******@herli hy.eu.veil.com> wrote:
I'm creating a common navigation bar of text "buttons" using CSS. On each
page, I want the corresponding button to be "inert" (no hover, etc) as a
visual clue to where you are.

I thought I'd include simple <p> tags, and style them the same way as the
<a> tags, but I can't get it to work - I get different margins in each case.

I've reduced the situation to the essentials here:
http://philipherlihy.members.beeb.net/CssMargins/

Is there a fix, or am I swimming against the current? Suggestions very
welcome - it's driving me mad!


Why use <p>? In the context of the rest of your code <span> would make
more sense.

Steve

Jul 20 '05 #2
"Philip Herlihy" <fo******@herli hy.eu.veil.com> wrote:
I'm creating a common navigation bar of text "buttons" using CSS. On each
page, I want the corresponding button to be "inert" (no hover, etc) as a
visual clue to where you are.

I thought I'd include simple <p> tags, and style them the same way as the
<a> tags, but I can't get it to work - I get different margins in each case.

I've reduced the situation to the essentials here:
http://philipherlihy.members.beeb.net/CssMargins/

Is there a fix, or am I swimming against the current? Suggestions very
welcome - it's driving me mad!


You should have mentioned that this quirk is specific to IE.

An unordered list is commonly accepted as the correct markup for a
navbar.

--
Spartanicus
Jul 20 '05 #3
Philip,

It isn't quite clear (to me) what it is that you are attempting to
accomplish. When your page opens in my browser the paragraph box is appears
attached to link 1 and link 2 appears as a box just to the right of the
paragraph and link 1, but for a small gap between them.

The confusion is that you start off by saying that you want an "inert"
effect, but the second paragraph you discuss margins.

Please clarify.

"Philip Herlihy" <fo******@herli hy.eu.veil.com> wrote in message
news:ci******** **@hercules.bti nternet.com...
I'm creating a common navigation bar of text "buttons" using CSS. On each
page, I want the corresponding button to be "inert" (no hover, etc) as a
visual clue to where you are.

I thought I'd include simple <p> tags, and style them the same way as the
<a> tags, but I can't get it to work - I get different margins in each case.
I've reduced the situation to the essentials here:
http://philipherlihy.members.beeb.net/CssMargins/

Is there a fix, or am I swimming against the current? Suggestions very
welcome - it's driving me mad!

--
############### #####
## PH, London
############### #####

Jul 20 '05 #4
I noticed that Message-ID: <ci**********@h ercules.btinter net.com> from
Philip Herlihy contained the following:
I thought I'd include simple <p> tags, and style them the same way as the
<a> tags, but I can't get it to work - I get different margins in each case.

I've reduced the situation to the essentials here:
http://philipherlihy.members.beeb.net/CssMargins/


I was going to suggest display: inline but I see you've done it. Is it
the spacing between that is the problem. I see it in IE but not in
Firefox

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 20 '05 #5
Philip,

(Earlier, I attempted to respond to your message. For some reason it never
posted.)

Exactly what is it that you want to accomplish? Is it to close up the small
gap between link 1 & link 2 or widen the gap between paragraph and link 1.

Please clarify what you want to appear.
"Philip Herlihy" <fo******@herli hy.eu.veil.com> wrote in message
news:ci******** **@hercules.bti nternet.com...
I'm creating a common navigation bar of text "buttons" using CSS. On each
page, I want the corresponding button to be "inert" (no hover, etc) as a
visual clue to where you are.

I thought I'd include simple <p> tags, and style them the same way as the
<a> tags, but I can't get it to work - I get different margins in each case.
I've reduced the situation to the essentials here:
http://philipherlihy.members.beeb.net/CssMargins/

Is there a fix, or am I swimming against the current? Suggestions very
welcome - it's driving me mad!

--
############### #####
## PH, London
############### #####

Jul 20 '05 #6
<p> lends itself better to editing in WYSIWYG mode in editors like
Dreamweaver, but I'll try using <span> and see what happens. - thanks!

--
############### #####
## PH, London
############### #####
"Steve Pugh" <st***@pugh.net > wrote in message
news:nk******** *************** *********@4ax.c om...
On Sun, 19 Sep 2004 15:19:12 +0000 (UTC), "Philip Herlihy"
<fo******@herli hy.eu.veil.com> wrote:
I'm creating a common navigation bar of text "buttons" using CSS. On eachpage, I want the corresponding button to be "inert" (no hover, etc) as a
visual clue to where you are.

I thought I'd include simple <p> tags, and style them the same way as the
<a> tags, but I can't get it to work - I get different margins in each case.
I've reduced the situation to the essentials here:
http://philipherlihy.members.beeb.net/CssMargins/

Is there a fix, or am I swimming against the current? Suggestions very
welcome - it's driving me mad!


Why use <p>? In the context of the rest of your code <span> would make
more sense.

Steve

Jul 20 '05 #7
I found I was getting the same quirk in Opera, so it's not just IE. I'm
grateful for the tip about unordered lists - I just thought a <p> was
simpler, as there is no need to turn off the marker. I'll experiment -
thanks.

--
############### #####
## PH, London
############### #####
"Spartanicu s" <me@privacy.net > wrote in message
news:0v******** *************** *********@news. spartanicus.utv internet.ie...
"Philip Herlihy" <fo******@herli hy.eu.veil.com> wrote:
I'm creating a common navigation bar of text "buttons" using CSS. On eachpage, I want the corresponding button to be "inert" (no hover, etc) as a
visual clue to where you are.

I thought I'd include simple <p> tags, and style them the same way as the
<a> tags, but I can't get it to work - I get different margins in each case.
I've reduced the situation to the essentials here:
http://philipherlihy.members.beeb.net/CssMargins/

Is there a fix, or am I swimming against the current? Suggestions very
welcome - it's driving me mad!


You should have mentioned that this quirk is specific to IE.

An unordered list is commonly accepted as the correct markup for a
navbar.

--
Spartanicus

Jul 20 '05 #8
The <p> tag (not being an <a>) does give the "inert" effect I want, in that
it doesn't trigger my default hover effect set using "a:hover". However,
p's and a's seem to have different margin properties - I'd have liked both
types to appear identically, and you can see from my example code that this
doesn't happen. The ultimately desired effect would be to have no gaps
between the items at all.

The example code omits everything which isn't necessary to demonstrate the
margin weirdness, so there's no hover effect.

Hope that's clearer (somehow I doubt it!). Thanks for your interest,
anyway!

--
############### #####
## PH, London
############### #####
"Richard B." <rb******@socal .rr.com> wrote in message
news:uI******** *********@twist er.socal.rr.com ...
Philip,

It isn't quite clear (to me) what it is that you are attempting to
accomplish. When your page opens in my browser the paragraph box is appears attached to link 1 and link 2 appears as a box just to the right of the
paragraph and link 1, but for a small gap between them.

The confusion is that you start off by saying that you want an "inert"
effect, but the second paragraph you discuss margins.

Please clarify.

"Philip Herlihy" <fo******@herli hy.eu.veil.com> wrote in message
news:ci******** **@hercules.bti nternet.com...
I'm creating a common navigation bar of text "buttons" using CSS. On each page, I want the corresponding button to be "inert" (no hover, etc) as a
visual clue to where you are.

I thought I'd include simple <p> tags, and style them the same way as the <a> tags, but I can't get it to work - I get different margins in each

case.

I've reduced the situation to the essentials here:
http://philipherlihy.members.beeb.net/CssMargins/

Is there a fix, or am I swimming against the current? Suggestions very
welcome - it's driving me mad!

--
############### #####
## PH, London
############### #####


Jul 20 '05 #9
Just so - it's the spacing inconsistencies that give me the problem - in my
example code I've removed anything inessential to demonstrating this. I got
the same problem in Opera, but haven't tried other browsers so far.

--
############### #####
## PH, London
############### #####
"Geoff Berrow" <bl******@ckdog .co.uk> wrote in message
news:5i******** *************** *********@4ax.c om...
I noticed that Message-ID: <ci**********@h ercules.btinter net.com> from
Philip Herlihy contained the following:
I thought I'd include simple <p> tags, and style them the same way as the
<a> tags, but I can't get it to work - I get different margins in each case.
I've reduced the situation to the essentials here:
http://philipherlihy.members.beeb.net/CssMargins/


I was going to suggest display: inline but I see you've done it. Is it
the spacing between that is the problem. I see it in IE but not in
Firefox

--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/

Jul 20 '05 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
10566
by: Donald Firesmith | last post by:
I am having trouble having Google Adsense code stored in XSL converted properly into HTML. The <> unfortunately become &lt; and &gt; and then no longer work. XSL code is: <script type="text/javascript"> <!]> </script> <script type="text/javascript"
17
2271
by: Albert Wagner | last post by:
I have a page with two frames. Frame1 contains an inline script. Frame2 contains inline and 2 loaded scripts. How may I call a function in frame1(inline) from frame2(inline or loaded)? Albert
11
5149
by: Scott Brady Drummonds | last post by:
Hi, everyone, I've checked a couple of on-line resources and am unable to determine how reinterpret_cast<> is different from static_cast<>. They both seem to perform a compile-time casting of one type to another. However, I'm certain that there is something else that is happening. Can someone explain the difference or recommend an online site that can explain it to me?
3
2763
by: | last post by:
I have been researching articles on google on how to create a simple RSS feed that sucks <title><blurb><link><date> out of a sql server 2000 database via an aspx page. I know it has to be pushed into a <xml> document but not sure which direction to take. Is there perhaps a starter document which uses sql server as the data source I can tap into.
1
4716
by: Michael Primeaux | last post by:
Why does the generic SortedList and generic SortedDictionary not define any virtual members? Thanks, Michael
3
2361
by: Nate Barney | last post by:
I have: // base class for Vector and Matrix template <unsigned N,typename Value=float> class NonScalar { public: Value *ptr() { return e; } const Value *ptr() const { return e; }
4
2316
by: Grizlyk | last post by:
Hello. Why were base class "typedefs" hidden by template<and explicit usage of them does not work too? Try open only one of the lines in the example below //using Tparent::Tptr; //typedef Tparent::Tptr Tptr; Consider example:
4
2380
by: Anastasios Hatzis | last post by:
I'm looking for a pattern where different client implementations can use the same commands of some fictive tool ("foo") by accessing some kind of API. Actually I have the need for such pattern for my own tool (http://openswarm.sourceforge.net). I already started restructuring my code to separate the actual command implementations from the command-line scripts (which is optparser-based now) and have some ideas how to proceed. But probably...
3
3380
by: ajay2552 | last post by:
Hi, I have a query. All html tags start with < and end with >. Suppose i want to display either '<' or '>' or say some text like '<Company>' in html how do i do it? One method is to use &lt, &gt ,&ltCompany&gt to display '<', '>' and '<Company>' respectively. But is there any freeware code available which could implement the above functionality without having to use &gt,&lt and such stuff???
14
3159
by: Michael | last post by:
Since the include function is called from within a PHP script, why does the included file have to identify itself as a PHP again by enclosing its code in <?php... <?> One would assume that the PHP interpreter works like any other, that is, it first expands all the include files, and then parses the resulting text. Can anyone help with an explanation? Thanks, M. McDonnell
0
8987
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9366
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9316
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
6793
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6073
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.