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 3273630
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T18:57:08+00:00 2026-05-17T18:57:08+00:00

I have webpages that contain links to word documents and pdf files. For each

  • 0

I have webpages that contain links to word documents and pdf files. For each link I want to display the file size and an icon showing what the file type is.

I’m thinking the best way to do this would be with CSS? Can anybody give me an example of how to do this?

Thanks!

  • 1 1 Answer
  • 1 View
  • 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-05-17T18:57:08+00:00Added an answer on May 17, 2026 at 6:57 pm

    When you create the link html you will need to specify the css class based on the file type you are linking to eg:

    <a class="document" href="http://someurl.com/some/file/worddoc.doc" title="Your file size could go here">Word Doc</a>
    <a class="pdf" href="http://someurl.com/some/file/somefile.pdf">PDF File</a>
    

    In your css:

    .document {
      padding-left: 24px; /* size of icon +  a bit */
      background: url('document.png') no-repeat;
      background-position: left;
    }
    

    In your code behind you can add the following to get the file size, assuming the file is on disk. You would then need to convert this to something more readable and add it to the “title” attribute in the example links above.

    System.IO.FileInfo info = new System.IO.FileInfo("filename");
    long fileSizeInBytes = info.Length;
    

    Or something along those lines. Above is not tested.

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

Sidebar

Related Questions

I have a rails app that uses PDFKit to render pdf versions of webpages.
I have a file that I include on all my webpages that contains the
I have a asp.net webpage that contain a custom login control like this: <div
I need to have a grid on one of my webpages that will be
I have a simple program that checks webpages for strings, example: Private Sub Button1_Click(ByVal
I have a Menu class that has a IQueryable property called WebPages. In the
I have an app that will display web pages within a UIWebView. The pages
I have an asp.net webpage that contain a gridview with edit, select and delete
Let's say that I have a link to a webpage that contains some text.
I have a GridView that (in one particular instance) would contain about 5000 rows,

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.