Jarren Ong Jarren Ong - 1 year ago 57
ASP.NET (C#) Question

Image display in css, html

for some reason I can't wrap my head around CSS and HTML.
I'm trying to get an image to display for a HTML div in my Master page. I'm using Visual Studio and they are in different files.


<%@ Master Language="C#" AutoEventWireup="true" CodeFile="MasterPage.master.cs" Inherits="MasterPage" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<asp:ContentPlaceHolder id="head" runat="server">
<div class="image" href="/css/masterCSS.css">

<form id="form1" runat="server">
<br />
<asp:ContentPlaceHolder id="ContentPlaceHolder1" runat="server">


div.image {


enter image description here

I tried runat="server" on the div and it didn't change anything.

Answer Source

If I corectly understand what you wanna do try this way:

<div class="image">
 <a href="/css/masterCSS.css">
 <img src="insert path to your image">

This is a method that doesent require CSS to ad content... in case you stil wanna do it that way just use your CSS and in my HTML code delte 3rd line...

I hope that helps :)

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download