Results 1 to 10 of 10

Thread: Link Box Line Problem

  1. #1
    Join Date
    Jun 2014

    Exclamation Link Box Line Problem

    Hello everyone, i have tried to searc this problem through and through and don't seem to find it. I don't know how to describe it in other words so:
    I have a <div> inside a parent link <a> element. Inside the <div> i put text. I styled the <div> element to look like a box the size of the text (here) but if you have noticed, when hovering the mouse at the same height that the button is (i have put that zone in yellow, remove it if you want, the link stays.
    Can you help me? How do I make this link zone as small as the button? I'm going to need to because i want to put more buttons, and space between them. I tried several things but nothing changes.
    Thank you in advance.

  2. #2
    Join Date
    Nov 2013
    You have not ended up anchor tag correctly. It became as a comment. Remove the comment section and display block for anchor then it will work.

  3. #3
    Join Date
    Jun 2014
    I don't get you question fully are you putting DIv in anchor tag?

    Can you explain clearly what you have done with some codes? If you post some codes then some one can help you out. Try posting it.

  4. #4
    Despite HTML 5's claims to the contrary, putting block level tags (like DIV) inside inline-level ones (like Anchor) is broken and buggy cross browser; there is a reason that up until HTML 5 came along it was invalid markup, and it's just another example of why I think HTML 5's "loosened structural rules" is a bunch of grade A farm fresh prairie pies.

    DIV is block level, don't put inline level tags like A around it... EVEN if HTML 5-tards say it's ok now.


    read the "contents" part -- inline-level tags except A.

    Inline level tags:

    Those are what can/should go inside an anchor. You use any other tags, you're doing something wrong.

    The block level tags:

    Cannot go inside ANY of the inline-level tags. Simple HTML structural rules that nobody bothered learning, and now HTML 5 just wants to piss all over.

    Mind you that's HTML level, NOT CSS "display" -- two separate things even if the display by default in most cases starts out the same.

    Which is why I'd lose the DIV and make the anchor display:block; Or as I often say, just as George Carlin said "not every ejaculation deserves a name" not every semantic tag needs a div around it or a class on it. Far too often people add DIV around (or worse inside) things where they aren't doing ANYTHING that couldn't be applied to the other tags already on the page. See the constant wrapping of DIV (or the new idiotic NAV tag) around menu lists -- only time you need to do that is full-width background with a semi-fluid inside; in most cases that means people are adding that extra wrapping element for nothing they couldn't just apply to the UL.

    Which is kind-of what it sounds like is your problem, adding a DIV where you don't need one.
    Last edited by deathshadow; 06-12-2014 at 01:56 PM.

  5. #5
    Join Date
    Jun 2014
    Then if i move the anchor tags inside the div, they will be around the text and only the text will be clickable, but i want something like a button, to make the whole box clickable. In that case is this possible?

  6. #6
    Join Date
    Jun 2014
    For some reason when I did it, the page is buggy and not fluid. My code is relatively microscopic compared to other pages, so what could cause the page's bugginess?

  7. #7
    Quote Originally Posted by dobrevdelyo View Post
    Then if i move the anchor tags inside the div, they will be around the text and only the text will be clickable, but i want something like a button, to make the whole box clickable. In that case is this possible?
    display:block; or display:inline-block; The former if you want it to act like a block-level element (while still not being block-level), the latter if you want it inline but want to be able to set height and vertical padding.

  8. #8
    Join Date
    Apr 2014
    Burnley uk
    I really cant understand what the question is. i mean why you need to put div inside of a anchor tag ? you can style anchor as you want.

  9. #9
    Quote Originally Posted by drwebsitesuk View Post
    I really cant understand what the question is. i mean why you need to put div inside of a anchor tag ? you can style anchor as you want.
    A lot of people just starting out -- and even a lot of so called "experts" cannot separate in their head that the default appearance of a tag has nothing to do with it's meaning, and still choose their tags based on that default appearance; the notion that you can make any tag look, do or behave like almost any other tag with CSS is lost on that crowd.

    As I often say, if you choose your tags based on their default appearance, you are choosing the wrong tags for all the wrong reasons.

    But that's why you'll constantly see people slapping DIV around things, inside of things, and all for no good reason; it's like how they can't grasp inheritance either and so slap the same class on a bunch of sibling level elements.

    There are some basic fundamentals to HTML and CSS that just aren't in the tutorials and books out there, mostly because the authors of such still have their heads wedged up 1997's backside. Do a "view source" on the default template for turdpress to see great examples of such developer ineptitude.

    For people just starting out -- they're just led astray. I can forgive ignorance; It just really yanks my chain when people who claim to be "experts" do the exact same type of asshattery; see the "WhatWG" and the train wreck of nonsense they came up with known as HTML 5.

  10. #10
    Join Date
    Dec 2015
    I cannot understand...

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center



X vBulletin 4.2.2 Debug Information

  • Page Generation 0.16037 seconds
  • Memory Usage 2,941KB
  • Queries Executed 15 (?)
More Information
Template Usage (33):
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_global_above_footer
  • (1)ad_global_below_navbar
  • (1)ad_global_header1
  • (1)ad_global_header2
  • (1)ad_navbar_below
  • (1)ad_showthread_firstpost_sig
  • (1)ad_showthread_firstpost_start
  • (1)ad_thread_first_post_content
  • (1)ad_thread_last_post_content
  • (2)bbcode_quote
  • (1)footer
  • (1)forumjump
  • (1)forumrules
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (1)headinclude_bottom
  • (10)memberaction_dropdown
  • (1)navbar
  • (4)navbar_link
  • (1)navbar_moderation
  • (1)navbar_noticebit
  • (1)navbar_tabs
  • (2)option
  • (10)postbit
  • (10)postbit_onlinestatus
  • (10)postbit_wrapper
  • (1)spacer_close
  • (1)spacer_open
  • (1)tagbit_wrapper 

Phrase Groups Available (6):
  • global
  • inlinemod
  • postbit
  • posting
  • reputationlevel
  • showthread
Included Files (26):
  • ./showthread.php
  • ./global.php
  • ./includes/class_bootstrap.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/functions_navigation.php
  • ./includes/class_friendly_url.php
  • ./includes/class_hook.php
  • ./includes/class_bootstrap_framework.php
  • ./vb/vb.php
  • ./vb/phrase.php
  • ./includes/functions_facebook.php
  • ./includes/functions_calendar.php
  • ./includes/functions_bigthree.php
  • ./includes/class_postbit.php
  • ./includes/class_bbcode.php
  • ./includes/functions_reputation.php
  • ./includes/functions_notice.php
  • ./packages/vbattach/attach.php
  • ./vb/types.php
  • ./vb/cache.php
  • ./vb/cache/db.php
  • ./vb/cache/observer/db.php
  • ./vb/cache/observer.php 

Hooks Called (73):
  • init_startup
  • friendlyurl_resolve_class
  • init_startup_session_setup_start
  • database_pre_fetch_array
  • database_post_fetch_array
  • init_startup_session_setup_complete
  • global_bootstrap_init_start
  • global_bootstrap_init_complete
  • cache_permissions
  • fetch_postinfo_query
  • fetch_postinfo
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • load_show_variables
  • load_forum_show_variables
  • global_state_check
  • global_bootstrap_complete
  • global_start
  • style_fetch
  • global_setup_complete
  • showthread_start
  • showthread_getinfo
  • strip_bbcode
  • friendlyurl_clean_fragment
  • friendlyurl_geturl
  • forumjump
  • cache_templates
  • cache_templates_process
  • template_register_var
  • template_render_output
  • fetch_template_start
  • fetch_template_complete
  • parse_templates
  • fetch_musername
  • notices_check_start
  • notices_noticebit
  • process_templates_complete
  • friendlyurl_redirect_canonical
  • showthread_post_start
  • showthread_query_postids
  • showthread_query
  • bbcode_fetch_tags
  • bbcode_create
  • showthread_postbit_create
  • postbit_factory
  • postbit_display_start
  • postbit_imicons
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • postbit_display_complete
  • memberaction_dropdown
  • tag_fetchbit
  • tag_fetchbit_complete
  • forumrules
  • navbits
  • navbits_complete
  • build_navigation_data
  • build_navigation_array
  • check_navigation_permission
  • process_navigation_links_start
  • process_navigation_links_complete
  • set_navigation_menu_element
  • build_navigation_menudata
  • build_navigation_listdata
  • build_navigation_list
  • set_navigation_tab_main
  • set_navigation_tab_fallback
  • navigation_tab_complete
  • fb_like_button
  • showthread_complete
  • page_templates