Yes you can write code on a mac for windows use. The only hard part would be for troubleshooting since you cant run it on a windows machine while you code. Sometimes different machines treat the code slightly different. (for instance, unix environments tend to be more picky when it comes to capitalization in directory names) As long as you follow the standards for the language it should work fine however.
The only requirement would be that you actually compile the final code on a windows machine. (There may be some mac compilers that allow you to compile into a windows executable. I am not sure since I haven't had to do that.) Thats why when you buy software you see different boxes for mac versions and pc versions, since the final compiled exe is machine dependent.
If you want the easiest route I would go with Java. Java bytecode is independent of the machine since it isn't actually compiled. It is ran by the virtual machine that is installed on each machine instead of being an independent program. Basically it is what they call an interpretive language instead of compiled.
edit:
I don't own a mac, but from what I've read mac computers come with a JDK (java development kit - that you use for creating programs) pre installed. You would probably want to go apple's website and update to the latest version. As for writing actual code, the only thing I can say is to buy a nice beginners java book. There are tutorials online if you google, but they never quite come to the quality of a good book.
(also, css isn't actually used to create software, its used in web page development)