TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
osyris zosar
NA
289
26.9k
C# mvc Html and css are not connecting
Mar 5 2021 10:34 PM
For some strange reason my css does not seem to connect Html
_layout.cshtml:
<!DOCTYPE html
>
<
html
lang
=
"en"
>
<
head
>
<
meta
charset
=
"utf-8"
/>
<
meta
name
=
"viewport"
content
=
"width=device-width, initial-scale=1.0"
/>
<
title
>
@ViewData["Title"] - test4
</
title
>
<
link
rel
=
"stylesheet"
href
=
"~/css/site.css"
/>
</
head
>
<
body
>
<
div
id
=
"Navbar"
>
<
div
id
=
"Navcentered"
>
<
div
class
=
"Navbuttons"
>
Home
</
div
>
<
div
class
=
"Navbuttons"
>
Upload
</
div
>
<
div
class
=
"Navbuttons"
>
Login
</
div
>
</
div
>
</
div
>
<
div
class
=
"Thecontainer"
>
@RenderBody()
</
div
>
<
footer
class
=
"border-top footer text-muted"
>
<
div
class
=
"container"
>
© 2021 - test4 -
<
a
asp-area
=
""
asp-controller
=
"Home"
asp-action
=
"Privacy"
>
Privacy
</
a
>
</
div
>
</
footer
>
</
body
>
</
html
>
Site.css
body {
margin-bottom
:
60px
;
background-color
:
red
;
}
.footer {
position
:
absolute
;
bottom:
0
;
width
:
100%
;
white-space
:
nowrap
;
line-height
:
60px
;
}
.container-field{
width
:
100%
;
height
:
auto
;
background-color
:
white
;
border-radius:
10px
;
box-shadow:
5px
5px
15px
#929292
;
display
: flex;
flex-wrap: wrap;
}
.card{
height
:
500px
;
width
:
220px
;
margin
:
15px
;
border-radius:
10px
;
margin-top
:
20px
;
box-shadow:
5px
5px
15px
#929292
;
text-align
:
center
;
}
.card-image {
width
:
100px
;
height
:
210px
;
margin
:
10px
;
background-repeat
:
no-repeat
;
background-
size
: contain;
}
.Thecontainer {
width
:
60%
;
padding-right
:
15px
;
padding-left
:
15px
;
margin-right
:
auto
;
margin-left
:
auto
;
height
:
600px
;
background-color
:
green
;
}
#Navbar
{
height
:
200px
;
background-color
:
green
;
width
:
100%
;
}
#Navcen
tered{
width
:
70%
;
}
.Navbuttons{
width
:
auto
;
margin
:
10px
;
padding
:
10px
;
height
:
100%
;
background-color
:
blue
;
}
In the Index.cshtml it does seem to connect:
@model IEnumerable
<
test4.Models.Product
>
@{
ViewData["Title"] = "Index";
}
<
h1
>
store
</
h1
>
<
h2
>
list here: @ViewBag.Message
</
h2
>
<
h2
>
last: @ViewBag.Message2
</
h2
>
<
h2
>
count: @ViewBag.count
</
h2
>
<
form
asp-controller
=
"Products"
asp-action
=
"Index"
>
<
p
>
Title:
<
input
type
=
"text"
name
=
"SearchString"
/>
Description:
<
input
type
=
"text"
name
=
"Description"
/>
<
input
type
=
"submit"
value
=
"Filter"
/>
</
p
>
</
form
>
<
div
class
=
"container-field"
>
@foreach (var item in Model)
{
<
div
class
=
"card"
>
<
div
class
=
"card-image"
>
<
img
src
=
"~/Images/Example.jpg"
alt
=
"example Picture"
width
=
"200"
height
=
"200"
/>
</
div
>
<
h2
>
@Html.DisplayFor(
modelItem
=
>
item.Title)
</
h2
>
<
h3
>
Price: @Html.DisplayFor(
modelItem
=
>
item.Price)
</
h3
>
<
p
>
@Html.DisplayFor(
modelItem
=
>
item.ProductDescription)
</
p
>
<
p
>
stocks: @Html.DisplayFor(
modelItem
=
>
item.Stock)
</
p
>
<
a
asp-action
=
"Details"
asp-route-id
=
"@item.Id"
>
View
</
a
>
</
div
>
}
</
div
>
Reply
Answers (
1
)
how to write generic polymorphic deserilization custom converter
asp.net core contact form add multiple data in message body