Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8339109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T04:47:33+00:00 2026-06-09T04:47:33+00:00

Razor, MVC3 code first, JQuery Accordion 1.8.22, jQuery 1.7.2. When I add an image

  • 0

Razor, MVC3 code first, JQuery Accordion 1.8.22, jQuery 1.7.2.

When I add an image to my jQuery accordion h3 header in a Razor view there is extra padding around the image. I created the accordion code from the jQuery site, when I run it as a html page the img perfectly fits on the header with no extra padding and when the accordion collapses there is a single pixel between the headings. When I take the exact same code with the same jQuery, style sheets and images and put them in a razor view the image sort of floats in the header creating a lot of unwanted space around it. I’ve tried this in both IE9 and the lastest Chrome and with different images and the problem persists.

Can anyone replicate this problem? Has anyone succesfully added an image to an accordion h3 header in Razor and gotten the image to fill the header without any extra padding?

<script type="text/javascript">
  $(function () { $("#accordion").accordion({  });   }); </script>

<div id="accordion">

<h3 style="height: 42px"><a href="#">
  <img src="@Url.Content"~/Content/themes/base/images/part1.jpg")"
                                alt="Part 1" style="border-style: none"/></a></h3>

Thank you for any help.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T04:47:34+00:00Added an answer on June 9, 2026 at 4:47 am

    I figured it out. It had nothing to do with Razor views. The custom css file generated by the jQuery site had a padding setting for the accordion header. Once I removed that css from the project the problem cleared up.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using Razor syntax in an ASP.NET MVC3 View inside a JavaScript code
Working with MVC3, Razor, Jquery, Javascript. The below code loops through and displays a
I have the following code within a razor mvc3 view that is duplicated in
Can you guys please check this code, it is MVC3 Razor <p><strong><u>Skills:</u></strong> @foreach (var
I am working on a MVC3 razor application. I have created a error Handling
I am building wizard step demo application with MVC3 and using razor view engine
I am using Entity Framework 4.1 code first with ASP.NET MVC 3 and Razor
I have a telerik grid in an asp.net mvc3 (RAZOR) View. While designing I
I am using MVC3 (Razor) with the Paging open source code here . The
I am building an application using MVC3, Razor view engine, Repository Pattern with Unit

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.